I'm trying to gather information from Google Analytics to build a recommendation engine for my site. The site consists of many pages, so I'm tracking the number of times a user clicks, for example, from page A to page B. Currently I can measure the A -> B
transitions on Google Analytics with previousPagePath = '/A'
and nextPagePath = '/B'
, but the question I really want to answer is, "Of all the visits to the site that included viewing page A, how many times were pages B, C, ... viewed in the same visit?"
For example, if the flow was A -> homepage -> B
, then that would not be captured by my current methodology, but would be captured by the broader measure. It looks like the "Visitors Flow" report on the Google Analytics web interface has the data I'm looking for, but I can't figure out how to access it programmatically via the API.
What is the best way to get this data?