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

How to use webDataStream to get data from Analytics Reporting Api after Analytics v4 update?


After https://analytics.google.com was updated to v4 there are no more views (profile ids). A user which registered after the update needs to set webDataStream properties in order to create and view a Report.

I can get those new properties from analytics admin api (https://developers.google.com/analytics/devguides/config/admin/v1) however i do not know how to use these properties with the analytics reporting v4 api. The analytics reporting v4 api requires the view (profile id).

I searched after some guides in https://developers.google.com but i cant find anything related to this topic after they updated analytics to v4.

You can also try this out by using the google analytics api explorer https://developers.google.com/apis-explorer and oauth playground https://developers.google.com/oauthplayground/ .

If anyone knows more Information about this, please feel free to share the knowledge. Thanks for your support and i hope that you guys will also be able to make some use out of this.


Solution

  • If you problem is, that you still want to access the data via old APIs on new GA accounts, there seems to be the option to still create a Universal Analytics account when creating the new property (extended options).

    You can also create both (GA4 and UA) the same time.

    Found it here: https://github.com/spatie/laravel-analytics/issues/371