Search code examples
google-analyticsgoogle-bigquerygoogle-analytics-api

Visit flow in Google Analytics


We're trying to study the behaviour of users before a transaction by analyzing the visit flow, via Google Analytics API.

We've found two limitations when ordering pages:

  • API has no an analogous to hits.hitNumber in BigQuery.
  • We're trying to order by time dimensions. The minimum level is ga:minutes, so when there are two or more pages visited at the same minute, we can't figure out which of them comes first.

Any idea about how to deal with it? Thanks in advance.


Solution

  • There is nothing you can do if you wish to use your current dataset.

    However, what you can do, in order to carry out these types of analysis in the future, is to create custom dimensions for sessionId and hitTimeStamp. These are simple to deploy through Google Tag Manager.

    A great article how to do this can be found here by Simo Ahava.

    That way can you can partition by sessionId and then order by hitTimeStamp to get your ordered page flow.