I would like to re-create the (ordered) list of pages each user went through when visiting my site using the Google Analytics API (core, v3). My understanding is that you need to:
- be able to tell visits apart
- gather the list of pages of that visit
- have a way of ordering those pages
1 . Telling visits apart
Can be done using using custom variables: OK
2 . List of pages viewed
Can be done using the below dimensions: OK
ga:pagePath
ga:landingPagePath
ga:secondPagePath
ga:exitPagePath
ga:previousPagePath
ga:nextPagePath
3. Ordering the pages viewed
My impression is that this is not possible for the following reasons:
- the absolute dimensions (e.g.
ga:landingPagePath/ga:secondPagePath
) only provide the first 2 levels - the relative dimensions (e.g.
ga:previousPagePath/ga:nextPagePath
) won't be enough to tell pages apart as soon as the same page appears multiple times in the navigation
For instance, let's say someone visits the below pages (numbers in brackets represent the order):
(1) A -> (2) B -> (3) A -> (4) B -> (5) C
If you try to pull the data via the API you quickly hit a wall:
dimensions=ga:landingPagePath -> (1) A : OK
dimensions=ga:secondPagePath -> (2) B : OK
dimensions=pagePath,filters=ga:previousPagePath==B -> (3) A, (5) C: PROBLEM
At this point we need to find out whether A
or C
is the actual page. This would be possible if we had the pageview timestamps, but unfortunately it doesn't seem available (you only have ga:timeOnPage
and ga:avgTimeOnPage
).
Have you found a way to re-create the order list of pages users viewed when visiting your site using the Google Analytics API?