I would like to know if it's possible to get the navigation path and timing spent on each page and some information about the client (browser, os, source) using the Google Analytics API. I could store the user id using Google Tag Manager DataLayer.
Is possible to get that information using Google Analytics API? (Another service is also welcome)
The Google analytics api supports a large number of dimensions and metrics which can be extracted. You should consult the dimensions and metrics explorer to see if these suite your needs. Your user id should be saved as a custom dimension if you wish to be able to extract that.
User Timings - Dimensions & Metrics Explorer
Platform or Device - Dimensions & Metrics Explorer
Related
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).
I am currently querying my Google Analytics data using the Google Analytics API via R.
I would like to query based on the unique client ID as my primary dimension, but I can't find this dimension using the API.
Is it possible to query Google analytics from the API using the client Id as a dimensions?
Update: Client ID is now available in Google Analytics Core Reporting api as ga:clientId.
I've added it in my script and works seamlessly.
Query explorer doesn't support it yet, hopefully soon...
The only dimensions and metrics that you can use with the Google Analytics API can be found in the Dimensions and metrics explorer you could also check the metadata API.
As you can see client id is not a valid dimension exposed via the Google Analytics API. You could set this in a custom dimension yourself however for it to work your going to have to make sure that its set on every single request you send to Google Analytics.
then you can use the custom dimension metadata
update
As of late 2018 early 2019 it is now possible to query ga:clientid from the google analytics api.
Google Analytics is rolling out a new feature called User Explorer that offers website administrators a chance to see a specific visitor interactions across my website. The timestamp of each activity is shown on the google analytics official user interface.
Is there any related API to get the data?
I have looking for the relative topic "google analytics api individual history".
However, get nothing.
I'm trying to load behavior flow data from GA through Analytics API. I've found here that I may do it using ga:previousPagePath and ga:pagePath dimensions. However in my case these dimensions are empty (not sure whether it's so due to mobile app, or due to some app bugs).
Generally I rely on ga:screenName. However there is no field ga:previousScreenName, so I can't do that the same way.
Is there any way to access behavior flow data in this case?
I see there is a flow diagram in Behavior -> Behavior Flow. Is it possible to access data this one is based on?
If you normally use ga:screenname that is because you have a application Google Analytics application. ga:previousPagePath and ga:pagePath are used for web Google Analytics accounts. There will be no data in those metadata items for an application Google Analytics account.
As you have already noticed there is no flow data for Application Google analytics accounts. You are limited to these meta data items.
You could add this as a feature request.
Is it possible to get a visitor flow associated with a given ga:transactionId through the Google Analytics API?
There's limited availability in ga:landingPagePath, ga:secondPagePath, ga:exitPagePath and ga:pageDepth
but a more complete path would be desirable
Thanks!
You can access the flow with the ga:previousPagePath and ga:pagePath dimensions and the ga:visits metric. You can play around with the output in the Query Explorer. For what its worth, here are a few of other related questions:
Get Google Analytics "Visitors Flow" data from API
Accessing Google Analytics Reports using the API
How to extract engagement flow data using google analytics reporting api