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

All Time Total View count for Google Analytics API?


Is it possible to count all time total view count in Google Analytics? For example, I want to do the following:

  1. I have a custom dimension that stores the "root url" (ex. www.contoso.com)
  2. Generate a request to get PageViews Metric and RootUrl Custom Dimension. Date Range will be set to before GA was setup so ensures to get "All Time".
  3. On returned query, sum up the Page Views of returned

Does Google Analytics allow this? Are there any caveats to doing this (ex. maximum date range, maximum allowed rows returned, etc.).

Thanks


Solution

  • Does Google Analytics allow this?

    Yes

    Are there any caveats to doing this (ex. maximum date range, maximum allowed rows returned, etc.).

    maximum date range

    Date range would be the start of when Google analytics founded sometime around 1-1-2005 until now. large date ranges may cause sampling which you can not 100% remove but this will depend upon how much data is in your account.

    maximum allowed rows returned

    Each page in the request returns a max of 10k rows. If you want more data you will need to check the pagetoken and paginate to get more data.