I am trying to integrate the enhance ecommerce in GA using the variables available in the data layer of GTM.
I have a collection of 8 Variables already being pushed into GTM when a confirmed order is received. Now is there a way to combine the variable into firing one single event with GTM, wither through custom html, or custom event and use it as a push to GA for ecommerce integration?
Related
We are using a custom tracking code to track events in UA, which was fine until now, but as there is a deadline to move all the events in GA4, I have already integrated the GA4 to the website, but I couldn't see those events there. Following is an example of an event I use.
_gaq.push(['_trackEvent', 'EventCategory', 'EventAction', 'EventLabel']);
Homepage=Category , PretSmallBanJan2023Stars = Event name , Banner= Event label
e.g. - _gaq.push(['_trackEvent', 'HomePage', 'PretSmallBanJan2023Stars-CH', 'Banner']);
There are over 15k events like this that are on the current setup which I have to move before July, so if there is any way to keep the same setup and see data in GA4 it will be greatly appreciated.
Kind Regards
You have to consider that in GA4 there are no more Category, Action and Label.
Follow This Link to move to GA4. Remember that there have been some major differences, as an example look at this Comparing metrics: Google Analytics 4 vs Universal Analytics.
In order to define a Custom Event in GA4 follow GA4 Custom Events
In order to define custom events you can use two methods:
1 - GTAG
2- DataLayer
I believe it would be easier if you use the first one or gtag.js API to send info or events to Google Analytic API. However, it is subjected to change(so you might be obligated to change something or update something on and off when Google decides).
1 - GTAG
As it is described in this link Set Up an Event for Website Apps for GTAG,
Before you begin:
Create a Google Analytics 4 account and property Create a web data
stream for your website Place the Google tag on your website It also
assumes that you have the following:
Access to your website source code The Editor role to the Google
Analytics account
To send events to Google Analytics this API has one function called gtag(), and whenever you want to send an event to Google Analytics, you use the following syntax:
gtag('event', '<event_name>', {
<event_parameters>
});
Finally, if you need the same metrics Category, Action and Label I suggest you to create Custom Dimensions for these three. So if you have an old-defined table in your Database, it is not going to change the fields or create loads to the developers. The documentation for creating Custom Dimensions and Metrics is here. Remember that it takes 48 hours for GA4 API to recognise your custom dimensions. There are some limitations as well that you can read at the link above.
2- DataLayer
In this method, you need to work with GTM or Google Tag Manager, as well.
To read more, you can follow this link GTM.
I have created 2 events with same name 'purchase' for universal analytics and for GA4 but the monetisation report is not correct in both the dashboards.
How can I create purchase event for both Universal analytics and GA4 and show the correct transactions in the report?
Also Can I create custom events like order tracking with product(item) parameter like purchase and create a custom report with all the parameters in the GA account?
Are you using a datalayer push for the ecommerce data that you want to display in your Analytics?
Or are you using dynamic values that you scrape from your website with custom javascript variables?
In any case, you have to include the correct structure in an event for the correct report to work.
I would recommend building a correctly formatted datalayer.push event that corresponds to GA4 standards.
For example:
How a purchase event should look like: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtm#make_a_purchase_or_issue_a_refund
Required and optional event parameters: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag
Then you can use a GA4 event tag to capture ecommerce data from the datalayer, and the UA tag has a checkbox that enables it to process GA4 data found in the datalayer.
This approach means that you will only have to support one type of Analytics structure on your website while you get ecommerce reports for both platforms.
I had to integrate the GTM and track few data into a webpage and im facing some comprehsion issues. I dont think it's code wise, but i don't get where i'm supposed to see the data that im tracking.
i've successfully added the GTM code into my application and defined some data to be sent inside the dataLayer variable, after that i can go to the GTM admin panel and choose to Preview and Debug, so i can see the data i'm trying to track and everything seems allright. Therefore, i don't know what happens to them next. I don't know where i can see the data that i track, where they are stored. I've linked my GTM account to my GA account so i can see the traffic and other datas, but not the ones i've put inside my dataLayer object.
Anyone know what are the next steps ?
Here's some screenshots of my tag
Thanks
I think Simo Ohava - the GTM "god" - is explaining it quite well:
Datalayer Basics:
https://www.simoahava.com/analytics/data-layer/
Google Tag Manager & Datalayer:
https://www.simoahava.com/analytics/google-tag-manager-data-model/
As far as I understand you, all your questions (including basics and how to access via tag manager - and more) are pretty nice answered/explained there.
I've linked my GTM account to my GA account
What do you mean by this? Where did you "link" the data? GTM tracks data via the tags you define to fire for various interactions on the pages, including pageviews, events, and transactions (all known as "hits"). Each tag that fires in GTM has an associated Universal Analytics property ID that comes from your Google Analytics account. You must include this ID in all your tags. This is where you tell GTM tags to send your data and this is where in GA you will find the reports on your data.
Simply pushing data to the dataLayer does nothing unless
you're also pushing events to it and using those events to trigger tags to fire
You've defined GTM variables to grab the data being pushed in
Your tags are configure to pull that data into your reports
EDIT
To pull data into GTM from the dataLayer, you need to do the following:
Make sure your data is pushed in the following format:
datalayer.push({
'event': 'your event',
'page': 'custom/path/path',
'otherData': 'custom dimension1',
'otherData2': 'custom metric1'
})
Create a Data Layer variable, whose name can be anything, and whose value is the name of the dataLayer key.
Include the Data Layer variable's name in whatever tag you need the data to apply to. For example, if it's a custom dimension you need to associate to your pageview, then go into the Advanced Configuration of the tag and add the data into the Custom Dimension section (remember to configure your CD in GA, and to include the index). You can be associating any kind of data to the specific tag (eg. page path, page title, page name).
Test and then publish your tag!
I'm implementing GTM on an e-commerce site. The problem I have is that we have lots of products and lots of promotions on the same page and Google is limiting the size of the request. That means that not everything pushed onto the dataLayer is getting sent to their servers.
On my last try, I separated the data onto different objects, and pushed them both to the dataLayer
But when I inspect the requests made to Google with a plugin like HttpFox, only the data from dataLayer[3] is getting sent.
What can I be doing wrong?
How does google expect us to send data in large e-commerce sites?
I've search a lot about this topic but couldn't find any help.
Send the first batch with the pageload, and every subsequent data with an GA event. You always need an interaction event (pageview or event) to send enhanced ecommerce data.
At the moment, as you have pointed out, GTM will pick the last thing you pushed to the datalayer (since the keys are the same the previous data is overwritten in the internal GTM data structure, which is an object rather than an array of objects).
So you push the additional data, add a custom GTM event ( e.g.{"event":"addData"} and build a trigger that fires on that custom event. GTM will pick the lastest ecommerce data from the datalayer and use it for GA. After the tag went through you push the next batch etc.
I'm using Google Analytics Enhanced Ecommerce with the datalayer on my webshop. Any event (product impression, detail view, add to cart, etc.) is added to the datalayer.
I'm also using Google Tag Manager. Currently, I just have one tag with Enhanced Ecommerce enabled, and 'Use datalayer' enabled.
I do get most data into Google Analytics, but in the Product Performance report, data like cart/detail and purchase/detail is all 0%.
I feel like I am missing some events that need to be added to GTM, but I am not sure which ones, and I'm not able to find clear documentation.
Should the single GTM tag with EE enabled cover everything, or should I add custom events? If so, which ones, and are there any examples available?
When you push e-commerce data to the dataLayer, you need to/should push an event as well, eg.
dataLayer.push({
'event': 'ee add to cart',
// The rest of your ecom dataLayer info
})
so that you can use an event tag that fires on the ee add to cart event and is also configured to read in the standard EE dataLayer. You should always push an event with the associated dataLayer and create event tags (or use the existing pageview tag) to capture that data. You should be able to find more examples here