Google Analytics Engagement Report API - google-analytics

Does Google Analytics Reporting API support calls to get the user engagement report data (as present in the Analytics website)
I searched but could not get any tangible information. I am not sure if this is same as what I am looking for.
Can someone please point me to some tangible info regarding this.

The relevant source for all "can I query this from the API"-questions is the "Dimensions and Metrics Reference" from the Google Analytics Documentation.
The closest thing to what you want is ga:sessionDurationBucket. However this dimension (it looks like a metric/number but is actually a string and a dimension) reports in second increments, whereas the report in the GA interface reports in 30 second increments. So if you query this from the api you would have to do the grouping into larger increments yourself.

Related

DataStudio Google Analytics Connector Showing Zeros for Some Metrics

I have a google analytics report in datastudio. One of the pages in the report is attempting to report on events. In GA when looking at the event in the e-commerce explorer tab I will see data for revenue, ecommerce conversion rate, per session value, but in my data studio report all values show as zero.
This is a straight google analytics data source (i.e. there is no data blending).
Screen shots below of the datastudio result and the analytics report for the data I am trying to match.
Every resource I can find says this should be possible and the fact that Google Analytics has the exact same data showing again makes me think this is possible.
Is there an issue with what I am doing or the metrics / dimensions I am calling? If not why isn't this working?
I have struggled with something like this too. I would guess that the problem is with the decimal places, which I couldn't get to work in GDS - zeroes all over the place, just like you are getting. When I multiplied the defined event value by 100, it all worked. Worth a try, I think.

Google Analytics API returning no data before 23/09/16

I have a Google Analytics API request that provides full data for any date after 23/09/16, but nothing before.
The metrics/dimensions in use are:
date
ga:sessions
ga:users
ga:deviceCategory
ga:sourceMedium
ga:campaign
I have created a custom report with the same dimensions/metrics in the web view, and I can confirm that the data does exist there (and is being provided). If I take out deviceCategory (or only have deviceCategory) then results are returned. This suggests to me that before this date, deviceCategory and sourceMedium/campaign were an invalid combination, but I can't find anything in the release notes to suggest this was changed and checking previous versions of the dimension explorer using archive.org does not indicate this was the case either.
I have raised a support request with Analytics support but they have said they don't have a team for API related issues.
Any help would be greatly appreciated. We already have a lot of reporting built around this combination and would like to be able to compare historical data.
Edit: I think this has something to do with the data retention settings in Analytics (which default to 26 months). Not sure why this particular combination would be affected as there is no user or event data required here.
You are right, it's because of data retention settings.
"The retention period applies to user-level and event-level data associated with cookies, user-identifiers <...>"
https://support.google.com/analytics/answer/7667196?hl=en
deviceCategory is associated with ClientID.

MCF channel report not in sync with conversion report in GA

Google Analytics MCF Channel Report isn't in harmony with the conversion report. Conversion from the direct traffic is much higher in the MCF report than the conversion report and conversion for 'email' is much lower in the MCF report than the conversion report. Other channels like social network etc. have less stark differences. All the traffic has been tagged properly since the conversion report is showing more believable results. Is it possible that it could be that the MCF channels take much more time to be updated properly. I checked the description for direct channel too and it just says that the medium should be none.
Lest you think there is something wrong with your code - not, it's just that MCF attributes differently than standard reports.
Standard attribution is "last non-direct click", so if somebody clicks on an ad, comes to your site, leaves and returns via a direct type-in he is still attributed to the clicked ad. This is a legacy from the original Urchin product (predecessor to GA). The idea is that you can influence marketing channels but not the direct channel, so conversions are attributed to the channel that you can control (I do not necessarily agree with that idea, but that's how GA does it). Net result is that non-direct channels receive more attribution at the expense of the direct channel.
MCF however attributes the same user more correctly to the actual last channel, so it is expected behavior that their are out of synch with the standard reports.
So your tracking code and tagging are most probably correct, and it is not a problem of processing latency, it is just the the reports use different attribution models.

enabling hourly data in google analytics

I have two view/profiles linked to my google analytics account. I want to fetch the hourly data for the current day, ie
start date:today
end date: today
with a few filters and dimensions.
Now I am getting the response for one view that means it is possible in google analytics, however for the other view its showing all the values as 0- this applies both to the gui and the api.
Can anyone suggest me how to enable it for the other view as well?
You cannot. Google Analytics needs some processing time. It might be that some data appears immediately, especially on small accounts, but it's not guaranteed and not a thing you can "enable" or count on.
Updated: Okay, that was a dumb answer. Still, there is a processing latency event in GA Premium. It is possible to get realtime data, but that's a different API with limited data (the core reporting API might return data, but no guarantees for that).
But I admit, since your problem is that you do not get data for the whole day yor have a different problem. But with a premium account you should be able to contact your account manager/technical support.

How to track "page views per minute" using Google Analytics Real Time API?

I'm using the Google Analytics Real Time API (https://developers.google.com/analytics/devguides/reporting/realtime/v3/) to track the active visitors per minute. For this, I use the metric rt:activeVisitors. Everything is working fine.
However, I want to track the page views per minute, but I did not find any overview of available metrics.
Is it possible to fetch the current page views?
You can find a list of the Dimensions and metrics available in the RealTime API here : Dimensions & Metrics Reference
It doesnt look like page views is something you can see in the RealTime API
As seen here: https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/pagetracking
You can use
rt:pageviews
the documentation is not really clear on the time frame. But my experiments seem to hint per minute.
The closest you can get is to use pagePath dimension and have activeVisitors as the basic metric (and the only one available, pretty much).
I don't think there is any real value in having live page view stats, you can find those in real time reports built-in standard GA reporting set anyway.

Resources