GA Reporting API session and product correlation - google-analytics

I ran into this issue a few months ago and nobody responded. It has come up again and I'm wondering if anyone knows why it doesn't work. Here's the original question:
Correlating certain metrics with Sessions and Products in Google Analytics API v4
The issue is correlating products to session/page information. If you setup an api query with a session variable (e.g. ga:sessions) or a page variable (e.g. ga:pageviews) and try to correlate it to a product dimension (e.g. ga:productSku), it will always give an empty data set.
I'm wondering A) why this data can't be correlated, B) why both google's dimension/metric explorer as well as their query explorer allow these combinations, but never return data, and C) is there a way around it?
I've tried this on about 10 clients that all have lots of product data and the result is always the same.
Edit: Adding example report json for ease of replication:
{
'reportRequests': [
{
'viewId': VIEW_ID,
'dateRanges': [{'startDate': '7daysAgo', 'endDate': 'today'}],
'metrics': [{'expression': 'ga:sessions'}],
'dimensions': [{'name':'ga:productSku'}],
'pageSize': 10000
}]
}

After exhausting every possibility and attempting to contact google support about this, there is apparently no work-around. It appears that any session level information (e.g. sessions) cannot be correlated directly to any product information. Unfortunately, you are limited to the other product level variables or page level (e.g. page views).
In the case of this project, we had to re-define some of our metric standards for GA for things that google didn't support (even though adobe does).

Related

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.

Google Analytics API doesn't give full results for certain catalogs

We use the google analytics core reporting API for our dashboards (GA plugin in power BI application).
What we need is the transactionid and the default channel grouping. This is working well for two of our websites.
But we have an issue with one website - Both Reporting and Raw Data which does not retreive the transaction ids with the corresponding default channel grouping. However, when doing a manual export from google analytics from acquisition channels by adding transactionid as a secondary dimension, we get the right information. We do not understand what is causing this misalignment.
Dimensions Chosen: Date, Default Channel Grouping and Transactionid
Metrics: Transactions, Revenue and Sessions(optional)
I get the correct number of transactions, but the issue happens when I try to combine more than one dimension(transactionid + default channel grouping).
Can you please some advice or suggest in going about getting the right information from ?
It is confusing when it works for two websites and there is 80% transactionid missing from the third website.

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.

Google analytics viewing access by userID

I have asked this question several times over on the GA forum, but no result. So maybe you guys can help...
I have set up google analytics with userIds on various pages of a site, with the aim of identifying exactly which pages are looked at by which users. So, sending GA the string
ga('create', 'UA-39536320-1', {'userId': '1001'});
means GA keeps track of all accesses by user 1001, and I can then (in theory) track all pages looked at by this user.
Trouble is, GA reporting seems to offer no out-of-the-box way of doing this. Indeed, some of the reporting features supposedly enabled by GA with userIds just don't seem to be available (eg coverage; user engagement; etc).
Am I the only one trying to do this? Seems other people have achieved a similar result using custom variables; do I have to do that, and give up on GA userIds?
The userId feature can be used in conjunction with a user id enabled view (profile) to analyze cross device sessions.
As pointed out by DalmTo it is possible to use custom dimensions to track any non PII information about a user. This article here gives a good example combining sending user scoped custom dimensions along with imported CRM user data to analyze and segments users for remarketing purposes.

Can Google Analytics do a user's who looked at x also looked at y?

Just wondering if this this possible? I realise you could never use it to display recommendations on a page but it would be useful from an analytics point of view to see for example what other products user's who've looked at product x have also looked at.
You can use Advanced Segmentation to do this.
Advanced Segments slice Google Analytics data on the basis of sessions. Sessions are a collection of pageviews that correspond to the popular notion of a visit.
If you create an Advanced Segment for users who visited /product/x/, it will return data from all the sessions in which that page was viewed. (Similarly, you could create a segment for /product/x AND /product/y. From there, you could filter it to only include your product pages, and exclude the original products themselves.) As a result, this session-based querying is perfect for your use case.
So, yes, you could use Google Analytics API data to inform a simple recommendations engine. The only caveat I'd give is that the Google Analytics API is a little slow, so you'd want to cache the data locally in your app, rather than querying it directly on every pageload.

Resources