Is the GA User Activity API compatible with GA4? - google-analytics

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.

Related

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).

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

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.

Define Google Analytics 4 custom dimensions via API

Is there a way to programmatically define custom dimensions using the Google Analytics Admin API (that works with GA4)?
I'm talking about defining the dimensions ahead of time so I can send them along with events, which is what you'd manually do in the Google Analytics user interface (under All events > Manage Custom Definitions). This is what I'd like to do programmatically. Once they're defined, sending these custom dimensions along with tracking events is easy enough (using gtag).
Apparently, this was possible in the previous version of the API, but that API says that it "does not support GA4 properties".
You already can programmatically define/create custom dimensions and metrics with the Google Analytics Admin API for GA4 properties.
Custom dimensions
Can be created with this method providing:
description
displayName
parameterName (it hasn't need to exist beforehand)
scope (User or Event)
Custom metrics
Can be created with this method providing:
description
displayName
measurementUnit
restrictedMetricType
scope (Metric_Scope_unspecified or Event)
Warning from Google: This is an early preview version of the API and
is subject to change. While we will try to notify you of upcoming
changes, you should expect to encounter breaking changes before the
APIs are publicly released.
Jan,
You are correct that the Google Analytics Management API V3 cannot be used to configure GA4 properties. The Analytics Admin API V1, which supports GA4, does not currently have methods to create custom metrics/dimensions.
I will update this question once we have more information on when this feature can become available.
Thanks,
Ilya
The Google Analytics Team

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

How to use Google Analytics web+api property to fetch analytics data and display on third party dashboard

AS Google Analytics Services SDK sunset On October 31st, 2019 they stop processing incoming hits for this property. and ask to use latest App + Web property, which utilizes Google Analytics for Firebase SDK.
I have successfully linked firebase with app+web property.
Now my question is , how i can fetch that analytics data useing that property ID and display on third party website? I am successfully able to capture app analytics data i just want to display that report with API. how i can use propertyID to fetch that data.
With web_app property there is no View(ViewID) as previous.
Any help on this?
For GA4 Properties, you can use the Google Analytics Data API v1 to fetch analytics data and display on a third party site. This API can produce reports of active users by date and other useful dashboards.
See the Data API v1's developers site for more information: https://developers.google.com/analytics/trusted-testing/analytics-data
When fetching analytics data in the Analytics v3 and Analytics Reporting v4 APIs, a view id is specified. As the question suggests, GA4 properties do not have views. GA4 properties cannot be used in Analytics v3 and Analytics Reporting v4 APIs.
This question asks about "App + Web" properties. For context, App + Web Properties were recently renamed to GA4 Properties. See the blog post for more information: https://blog.google/products/marketingplatform/analytics/new_google_analytics/
There's no public API to get the firebase-backed App + Web analytics data. However, you might have enabled BigQuery integration and use BigQuery API to make requests to analytics tables.

Resources