Google Analytics Reporting API V3/V4 compatibility with Google Analytics 4 (GA4) - google-analytics

Today we use Google Analytics Reporting API V3 (core reporting API v3 using java SDK google-api-services-analytics-v3-revxxxx.jar) in our system to connect and get data from Google Analytics. For this, we need properties that are based on Universal Analytics (UA-xxxx). We use the service account approach for connecting to Google Analytics and fetching data.
From looking at the information available at https://developers.google.com/analytics/devguides/reporting it seems that we cannot use the v3 API with the new GA4 properties and we would have to use Data API V1. Is this correct? Any information around this would be helpful.

Yes, the data model of GA4 is completely different from that of Universal Analytics for which dedicated APIs are required.
To date, GA4 is still young and constantly evolving so many new improvements and features will come out in the near short future also from a programmatic point of view.
Anyway you can still create a Universal Analytics Property by 'show more option' button when you create a new one.

Related

Is the GA User Activity API compatible with GA4?

Is it possible to retrieve user's data from a GA4 property using the User Activity API (https://developers.google.com/analytics/devguides/reporting/core/v4/user-reporting)?
I have checked the documentation but have not found anything so far. Some endpoints of the v4 API explicitly display a warning saying it is not compatible with GA4, but this User API does not display such warning.
no it is not as stated at the top of the page for the Reporting api Overview there for it apply sto the full Reporting API v4.
Note: This API does not support Google Analytics 4 (GA4) properties. Please use the Google Analytics Data API to access the new reporting features for GA4 properties.
As far as i can see there is no equivalent in GA4 yet.
Note: I pinged the team to have them add the quote to the top of that page as well.

Can I switch my Google Analytics property from GA4 to UA?

For some reason PowerBI does not accept GA4 as a connection, so my data is stuck in GA4.
PowerBI does support Universal Analytics (UA), but I cannot find a way to convert my GA property.
Is there a way to do this or should I start over again and create a new property as UA?
PowerBI currently doesn't support GA4 as a destination because the underlying api is not product ready yet. See the response in the microsoft power BI community here: https://community.powerbi.com/t5/Desktop/Power-BI-Google-Analytics/td-p/1679530
For information about the api's and their current state:
This is a link to the api documentation the plugin is using (for universal analytics): https://developers.google.com/analytics/devguides/reporting/core/v4
This is a link to the api documentation of GA4 (which is still in beta): https://developers.google.com/analytics/devguides/reporting/data/v1
Regarding a solution for your issue:
In GA4 is it possible to export data to big query, which can be processed there and imported to PowerBI: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-bigquery
The export only works from the moment you enable it, so it is not possible to access the data this way before the enablement.
Second option is using data studio to connect to your GA4 data to be able to access the data you have measured before.
First off as everyone says you cant change the type of your Google analytics account if it was created as UA then its UA if it was created as GA4 then its GA4. There is also no way to exxport data.
Now lets look at the underlying cause of your problem Google analytics connector in Power BI Desktop rely on the Google Analytics Core Reporting API this API is used to extract data from Google Analytics UA accounts. There is a very big difference between the underlying data structure of a UA account and a GA4 account they are not completable in any way shape or form.
Thats why the Google analytics team is currently developing the Google analytics data api This api has the ability to connect to Google analytics GA4 accounts and extract data. At the time this post was created Power BI Google Analytics The Google analytics data api had just been released and was still in alpha test phase as you can see from the change log this API is still under development. I haven't checked but it looks like it may even be out of beta now. (TBH I am not really sure of the exact date it was released publicly as I have been in the alpha test group for a long time.)
However that being said a lot of the client libraries used by this api are still under development as well Google .Net Client library for Google Analytics Data API for example is still in beta. At the time that post was written i am almost 100% sure the client library had not been released.
This means that any power bi connector is probably not going to be released until both the API and the client library are considered stable. I know the team is working hard on the API and I Haven't seen any breaking changes in a very long time.
So to the user who added a bounty to this looking for an updated answer.
IMO I don't think you have long to wait before everything is stable enough for applications like the Power BI to start appearing that support GA4. That is assuming that someone creates one.
You can't covert GA4 to UA (or UA to GA4).
In your case you can create a new UA Property and start to track in it:

Retrieve GA3 and GA4 data with same API?

So we are using Reporting V3 API in our custom dashboard to retrieve custom reports from multiple GA properties. Now some of our customers have GA4 properties which doesn't show up in properties list. Question is, to support both versions (GA3 and GA4) the only alternative now is to use Reporting V3 and Data API for different properties or did we miss something and there's one API which can be used for both GA versions?
There are two versions of Google analytics now Universal analytics and GA4 they are completely different and have different APIs designed for each one.
Google analytics reporting api allows you to access data from Universal analytics accounts.
Google Analytics GA4 is a completely different system and is not supported by the reporting api to access data behind a GA4 account you will need to use the Google analytics data api
there is also the Google analytics admin API which is the equivalent for the Management api for GA4. so if you want to be able to list a customers GA4 accounts you will need to use that api as well.
Note: The admin api is currently in alpha, and the data api is currently in beta. Take that into account before developing production applications using these apis.

How to add Google universal analytics to Google analytics 4 only?

I have create a Google analytics 4 property and been running and gathering data for while now.
I need some external tools to integrate with it and I saw developers reporting that GA4 does not have an API yet, so it does not support any integrations.
I saw that you can create a dual UA and GA4 property but I was unable to find how to add UA to existing GA4 property.
In short: How do I add universal analytics view without loosing any data or integrate with external tools i.e. slack bot posting regular updates? (work around with big Query?)
GA4 does have an API. You can use the Google Analytics Data API v1 to fetch analytics data. The developer's site for this API has more information: https://developers.google.com/analytics/devguides/reporting/data/v1. The API is currently available at an Alpha (preview) stability. The API will be entering Beta shortly.
When you read about creating dual Property it means tracking with both GA4 and Universal Analytics separately. They are 2 different scripts that track data in different platforms with different model.
Therefore you can create a new Universal Analytics Property in your Google Analytics Account and insert that code in the pages of your site, however it will start tracking from that moment on, you cannot have the history, both because you cannot transport data from a Property to the another (even if they were 2 Properties of the same type), and because GA4 has a completely different data collection model.
In any case, from the moment you start tracking with Universal Analytics then you can query the data with the relative API (i.e. Analytics Reporting API).

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.
Marius,
The Core Reporting API V4 does not support GA4 properties, and can only be used to query Universal Analytics properties. In order to access data in the new GA4 properties, please use the Google Analytics Data API V1 (currently in preview).
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

Resources