Search code examples
google-analytics-api

Analytics API: how to query for "page path level 1"


All of our customers have their own folder on our servers. I want to track the pageviews they make. In Google Analytics, I can do that by making an custom report: metrics (pageviews), dimensions (Page path level 1).

However in the api it seems that that dimension isn't available. You can query for "ga:pagePath" but that seems a little bit of overkill. For one month with "Page path level 1" I would get about 450 results, with "ga:pagePath" I get 7 500 000 results.

Is there a way to get the same results via a query like in my custom report without having to process the data myself? It's possible offcourse but I would like to avoid it.

Thanks


Solution

  • Try using dimension ga:pagePathLevel1. It's not documented, but has worked for me.