Google Analytics web UI has a neat report called "Users Flow" which shows user behavior on your website as the navigate to different pages. The raw data for this report is understandably not accessible from the web UI since it would include many thousands of rows. It should be available through the API however. I have read this to understand the basic framework of how to do this.
However, the results I'm getting from these efforts don't match what I see on the site, which leads me the believe that I am making an error somewhere.
Exhibit A: One particular interaction I'm investigating is users navigating from the home page to a particular sub-page. This interaction is popular and therefore visible in the web UI. It shows the following:
Home -> Page A = 9.4K Users (doesn't give the exact value =/)
However, my results when investigating thought the API do not match. My basic method is this:
dimensions="ga"landingPagePath,ga:secondPagepath"
metrics="ga:sessions"
Which gives the following result
Home -> Page A = 1,993 Users
I also get the same result from the following query:
dimensions="ga"previousPagePath,ga:pagePath"
metrics="ga:sessions"
I can't figure out why these two should not return the same result, and I fear I'm missing something obvious. Thanks in advance for the help!
EDIT
It turns out the method using
dimensions="ga:previousPagePath,ga:PagePath"
Returns a different but still incorrect answer of 2,951 Users