I need to know why my Purchases are not being stored in Google Analytics, the Preview of Google Tag Manager shows that I've enableEcommerce set to false, but as you can see I've this in Google Analytics Turned ON.
After following documentation, I've this dataLayer only in the thank you page:
As you can see:
1) I'm generating the products Array,
2) The tag is fired correctly.
3) enableEcommerce : false
Point 3 is what is not clear to me, because I've Ecommerce Enabled:
enableEcommerce: false
UPDATE 1
Based on kgrr's answer, this is my current setup.
event fires
dataLayer:_
dataLayer (first field name)
Google Analytics TAG Variable
UPDATE 2
Not as conversion:
Based on all the details, you have shared, there a few errors, that you should fix, to get your purchase tracking working.
Your tracking ID is incorrect. You can provide a tracking ID either by adding it directly as a Tracking ID, or adding it as part of a Google Analytics Setting variable. (Where it will be provided similarly as Tracking ID). At the moment, you pass your Google Analytcs Settings variable into the tracking ID field. As you have already prepared this type of variable, I suggest to use it in its proper place, but remove tracking ID provided from the Google Analytics tag. The only setting to be overwritten, is the enhanced ecommerce setting. (As it seems from the images.)
Your purchase object is not following the enhanced ecommerce format. Based on the documentation, the products array is part of the purchase object. At the moment, they are siblings in your code, so GTM won't be able to process, and append it to the event.
Your product objects are not following the enhanced ecommerce format. At the moment, you are not using the proper keys in your product objects, so GTM won't be able to pass this data to Google Analytics. This is a general reference about the product data, and this is a working example, how various attributes are passed to GTM. You should fix the key-value pairs to match the format requested by GTM.
Update:
Also, you must ensure, that enhanced ecommerce feature is enabled in your Universal Analytics tag or your Google Analytics Settings variable. If it's not enabled, GTM ignores this data.
Related
I have an issue with some inconsistencies in the data passing through to Google Analytics (GA).
I'm sending Shopify purchase event data to GTM formatted as per the Enhanced Ecommerce docs here. While I can confirm my Order IDs do not have any prefix, eg.. simply 12345, some records populated on GA include a # prefix while others do not.
I'm wondering if there are any settings or quirks with GA configuration that could be leading to this inconsistent behavior.
Thanks!
You can use a Search and Replace filter to apply to the View where you define a rule based on your pagePath where the orderid is present.
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
I have a gtag account setup and that also connects to google analytics.
And I have made a successful tag/trigger to make event tracking for when an FAQ item is opened at my clients FAQ-page
I am sending the trigered FAQ question text as a value as well. And I wish to have a list in Google Analytics in which the questions are shown in a list.
Am I missing something? Should I setup the trigger/tag in another way, or am I missing something in the GA.
Thanks for taking your time.
DEBUGGER
TAG CONFIGURATION:
GA:
The event value in Google Analytics must be a number. You are currently passing {{Click Text}} string, which actually gets ignored by ga object, and will not reach Google Analyitics. More details on event tracking.
Basically, you should send this text data in a text field into Analytics.
Original recommendation, using custom dimensions:
I recommend you to set up a hit based custom dimension, where you can submit additional text data in connection to your event. You'll be able to analyze it as a secondary dimension in standard event reports, or by creating custom reports.
In GTM, you have to modify either the Google Analytics setting variable, or the Analytics tag itself, and assign the desired value (click text in your case) to the custom dimension ID, which you have created in Google Analytics. E.g. custom dimension 6 gets passed like this:
An other option, based on Eike's suggestion:
You can also use any of the other standard event fields for this, e.g. send it in the label. As pointed out, this can even hold larger set of data (500 bytes), compared to custom dimensions (150 bytes). This is also easier to be implemented in GA and GTM as well, as you don't have to deal with custom dimension creation and reporting.
As my heading suggest, I would like to know if it is necessary to implement a Data Layer to push Custom Metrics and Custom Dimension data from Google Tag Manager to Google Analytics.
Some guides I have seen seem to suggest you do not need to implement a Data Layer: http://mixedanalytics.com/blog/custom-metric-ga-google-tag-manager/
However, there are others that suggest you need to: https://campaigntail.com/Blog/Ultimate-Guide-Custom-Dimensions-Metrics-Google-Analytics
When I say implement a Data Layer, what I mean is insert code like this into your website:
// Set value for custom dimension #3.
ga('set', 'dimension3', 'variant a');
// Set value for custom metric #1.
ga('set', 'metric1', 1);
// Send pageview. Passes the dimension and metric to GA.
ga('send', 'pageview');
I have tried implementing the first method but failed. So was wondering what is the right way to go about it.
Thank you.
(Edited because of stupid). Your code example does not show a datalayer, it shows a part of Google Analytics tracking code that wouldn't event work with a standard GTM setup (because GTM uses unique tracker names).
A datalayer is an an array of JSON objects that you can use as a container for your data. However GTM is happy to accept data from almost anywhere, including values that are directly written into your tracking tags. So no, you do not need a datalayer (other than in the sense that GTM will automatically create the datalayer that it needs to function).
Remember the data takes some time (up to 24 hours) to show up, and custom dimensions/metrics are not part of the standard reports. You have to create custom reports, or select your custom dimensions as secondary dimension in a standard report.
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.