Search code examples
javascriptnode.jsgoogle-analyticsgoogle-analytics-api

retrieving Google Analytics' behavior flow via google's API?


I am successfully using node.js to download some data from Google Analytics with the excellent google-api-nodejs-client.

Unfortunately I didn't find yet a way to download the data presented in the Behavior/Behavior Flow page.

Anyone has some ideas on how to retrieve flow data from the APIs?


Solution

  • The Behavior -> Behavior flow reports visualizes the path visitors traveled from one Page or Event to the next. I dont know of any documentation as to exactly how Google Creates them but i can make a few educated guess's.

    If we look at the dimensions available under Page Tracking there are a few dimensions that look interesting.

    ga:landingPagePath  
    ga:secondPagePath
    ga:nextPagePath
    ga:previousPagePath 
    

    I would start by exporting those and see if you cant piece the flow together. Remember you don't have and can't get the actual Session ID for the user. This will make it either hard or impossible for you to recreate the flow in the same way that Google does. But you might be able to get close.