Google Analytics 4 (GA4) Event Counts Different from UA - google-analytics

Anyone migrated from Universal Analytics to GA4 showing event counts slightly off for custom events? I am using the same triggers in GTM so why would there be a discrepancy? What could cause this? I understand session counts differ between GA4 and UA but why would custom events using same tags and triggers?

I had the same issue with purchase events being different for UA vs. GA4.
Universal Analytics was always showing higher numbers and the triggers were exactly the same.
Then I enabled data export to BigQuery and it turned out that GA4 shows only those transactions in the GA4 UI that have a value for the field user_pseudo_id (you only see this field in the BigQuery data export). There were transactions where the field was null and apparently these dont show up in the UI.
I would recommend looking at raw event in BigQuery, the data export is for free as long as you dont go crazy with ETLs and queries.
Check your data with this query:
SELECT event_name, event_timestamp, user_pseudo_id, ecommerce
FROM `{project}.analytics_{replace}.events_{date}`
WHERE event_name = "purchase"
order by event_timestamp
empty user_pseudo_id are not considered in the GA4 UI reports

Related

Google Analytics purchase event - track time with date

Does the time get stored with the date OOTB with the Google Analytics 4 (GA4) on eCommerce events?
On my company’s implementation when I look at the data stored to e-commerce events, like the purchase dimension, everything is showing as occurring at 12am. Do you know why this is? Is it a config issue or the way I am connecting?
I’ve seen posts where people create JavaScript variables to track time in GA4 and save to a dimension but this makes no sense given the high cardinality of time. I would have thought it would be more efficient to store as a datetime data type and track as part of the GA4 application.
Does anyone here see the time an event occurred on GA4 eCommerce events?

Retrieve Google Analytics 4 event parameters via API

Google Analytics (particularly version 4, "GA4") has various predefined events, each with its own parameters. E.g. the purchase event has an items parameter, which contains data such as item_id and item_name for each purchased item. JS code on a website can send these events and pass the extra data, and I can actually see the data in the "Analysis hub" in the Google Analytics interface.
Is there a way to also fetch this extra data using the Google Analytics Data API? There is a way to retrieve some predefined dimensions and also "custom dimensions" (via customEvent:parameter_name), but e.g. purchase item data doesn't seem to be a part of that.
Do I have to define custom dimensions (e.g. a purchasedProductId) and send them in addition to the items parameter, if I want to access this data via API?
Jan,
Ecommerce reporting is not yet supported in the Google Analytics Data API. I will update this question once I have more information about the timeline of this feature implementation.
Thanks,
Ilya
The Google Analytics Team

iOS: Issues with switching from Google Analytics to Firebase Analytics

I am using Google Analytics for years for my iOS apps and was truly satisfied with it. For my regret Google is sunsetting Google Analytics later this year so I am switching to Firebase API so I can keep tracking my apps. I already done most of the integration work and can see the events appearing in Firebase console. However, I can't see custom parameter values but only event count.
For example, sending event named add_book and adding parameter named isbn with value of 1234, I will be able to see in the console only the number of times that add_book arrived and also that it contains an isbn parameter. However, it seems there is no way to view the value (i.e. 1234) of the isbn parameter. I registered the isbn parameter for the add_book event as required. Am I missing something?
Does having the full functionality of the sunsetting Google Analytics (including advanced filtering + regex filters, etc.), means I should use both Firebase Analytics and BigQuery together?
By the way, I linked Firebase Analytics with BigQuery and exported the data as suggested by Firebase Analytics, but I can't see any Analytics tables yet in BigQuery. Do I need to allow several hours before I can view the exported data?
As of March 2019, Firebase Analytics is not so easy to use or test when setting it up (in comparison to Google Analytics). The main steps for setting up event parameters are:
Send your events with their event parameters. Send at least 80-90 events of one type, otherwise the parameters will appear as zero or "not set", until you reach 80 individual events.
The events will not display in the website until after one day. So wait for 24 hours.
When the events appear on the website, you must register their event parameters, with the '3 dots' menu -> "Edit Parameter Reporting" - Like this:
Then:
(Image credit: Firebase Analytics custom events params and Firebase Analytics. Can not add custom parameter to event )
After registering the event parameters, you must wait another 24 hours to see the parameters displayed on the website.
More info:
https://www.reddit.com/r/androiddev/comments/9zbvk4/alternative_to_google_analytics_not_firebase/
https://www.tatvic.com/blog/firebase-analytics-reporting-tips-overcome-limitations-favorite-mobile-app-analytics-tool-google/
In your event overview from Firebase Console you can enable parameter reporting for individual events. The option is found in the 3 dot overflow menu.
You can do that for up to 10 unique text parameters and 40 unique numeric parameters.
Beyond those limits or for more control BigQuery is the way to go. And yes you need to wait for your first data in BigQuery. They populate a new table with one days data every day once.

User ID not showing up in BigQuery

What can be the reason the user_id is null in BigQuery? Data from Analytics is sent to BigQuery but the user_id is not passed along. The user_id is sent to Google Analytics but what could be the reason it is not available in BigQuery?
Confirmed by Google Analytics 360 support, the userId only have non-null values in BigQuery tables that are exported from User-ID enabled views in Google Analytics. For non-User-ID views, you only see null values for the userIdcolumn and you have to use a custom dimension to capture User Ids and query them in BigQuery.
In order to check which Google Analytics view you have linked to BigQuery, you can either look at the dataset ID in BigQuery (which is the same as the Analytics View ID) or directly the linked Google Analytics view in Admin > All Products [Property column] > BigQuery in the Google Analytics UI.
I am operating under the assumption that this field is intentionally held out from all Google Analytics -> BigQuery extracts based on the following:
https://support.google.com/analytics/answer/6205850?hl=en#limits
Of particular note, the line "The User ID value can not be queried as a dimension in reports in either the web interface or the APIs". I take this to mean that it will never leave the confines of Google Analytics, including to BigQuery.
I have not been able to get anything but null in my tables either.
Sorry I do not have better news for you!

Track individual via Google Analytics

I am new to Google Analytics. I have a conversion set up, and I'd like to capture demographics for individuals who convert at e individual level. When a user converts, I'd like to pass the statistics from Google Analytics into my own database, or keep a record of the ID assigned at conversion in Google Analytics and download the data. Is this possible? I want to do analysis on who is likely to convert versus not - age, shopping habits, etc - and link these details back to the type of specific conversion.
Thoughts?
We if want to add add track users at individual level, try creating a Custom diamension and passing the userID everytime you make a GA call.
Next to view the same :- in tables that you view your analytics data, there will be this option called 'Secondary diamention', from the list that appears.. Choose the custom diamension name that you had assigned. Now you will be able to see each row with the userID along slide.
Add user ID to your tracking script
The first step to your question is to add the user ID to your tracking. If you have some way to identify users on your website (ie: through email marketing tool, your CRM, etc), then you should set up user ID tracking. Here is the Google Dev article about that:
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id?hl=en
However, basically... you just have to add this to your tracking script (replacing the 'create' line you currently have, replacing "USER_ID" with the user ID your system gives them.
ga('create', 'UA-XXXXX-Y', { 'userId': USER_ID });
In addition, I usually include this UserID as a custom dimension, so that I can view it in Google Analytics and other reports. To do this, first set up a custom dimension for your ID, as a "User-level" dimension. Then just add this after your user ID is available (assuming this is your first custom dimension):
ga('set', 'dimension1', USER_ID);
Connect User ID to Demographics
Unfortunately, the demographics information that Google Analytics provides (under "Audience") is not compatible with custom dimensions (like userID). So, the API only allows you to pull the audience data in aggregate (ie: connected to City, number of users, pageviews of those types of people... etc). If this works for you, check out the GA Query Explorer (below) to try out different combinations of dimensions & metrics to drill down as deep as you can and maximize the information you gain from this demographic info.
Connect Google Analytics Data to Your Database
In order to connect GA data to your database in an automated fashion, you will need to set up some kind of scheduled process that runs a query off of the Google Analytics API. To explore what combinations of metrics and stuff are available, I'd suggest checking out the Google Analytics API Explorer and the Google Analytics API reference material. What I did was set up an SSIS package (using SSIS GoogleAnalyticsSource) as the data source, which made it fairly easy. Then just scheduled that to run daily, populating the data I want into my database.
Alternatively, you could download less complicated reports directly from Google Analytics and import them into your database with something like SQL Server Management Studio.

Resources