"[object Object]" displayed for items array within Analytics 4 debug - google-analytics

I'm migrating a website that currently uses UA analytics configured via GTM to use Analytics 4.
Currently, the Website has the following purchase push event:
({'event':'purchase','ecommerce':{
'purchase'{
'currency':'GBP',
'value':'24.99',
'tax':'6.3300',
'shipping':'6.6600',
'coupon':'',
'transaction_id':'450048423',
'total_qty':'1',
'items':[{
'name':'Lasher Tools Deluxe Lopping Bypass Shears',
'id':'119836',
'price':'24.99',
'quantity':'1.0000'
}]
}
}
);
I've created a new tag for the Analytics 4 conversion which uses variables populated from the dataLayer of this push. This works fine for everything aside from the items array which returns as [object Object] when debugging via Google Analytics:
Image for Analytics debug
Here's how the items array looks when I view via the Tag Manager debug:
Tag Manager Debug
I can see the 'purchase' event within Analytics, however if I view the 'ecommerce' tabs then the revenue shows as £0.00 and the items columns are all empty which I can only assume is because of the items array issue?

Related

Google Tag Manager - custom event - category is undefined

I have started using Google Tag Manager recently and I don't understand why one of my variables remains undefined while everything seems to be set up correctly.
Here is first the code that I use to create my datalayer:
<script>
window.dataLayer = [{
'pageCategory': 'test1',
'Device' : 'test2',
'Manufacturer': 'test3'
}];
</script>
I have created custom dimensions based on those variables and I can find them in Google Analytics. So far, everything is all right.
I then want to track a click on a button that leads the users to an external link. I use the following code:
window.dataLayer.push({
'ShopURL': url,
'ShopName': shop_name,
'PriceOffer': price,
'event': 'ClickPrice'
});
I have checked the content of each variable with a console.log and they all display the correct values.
In GTM, I have created datalayer variable for each one of them, I have created a custom event to push them to Google Analytics. I have taken "ShopName" for event_category, "Device" for event_action, "PriceOffer" for event_label.
When I look at the data in Google Analytics I see that event_category is undefined while event_action has the correct value. It looks like the event is fired correctly because I can only see it in GA when I click on the button but somehow some variables are not populated correctly.
You can see it in action here: https://www.mobilemultimedia.be/en/nokia/price-nokia-8.1 (click on one of the "check offer" button to trigger the event)
With GTM preview in the browser I see all the correct values.
Any idea?
Additional info
Here is a screenshot of the variable configuration in GTM:
I'm sorry, it's in French but you can see the variable with the right name.
I believe you have your trigger set incorrectly.
I think it might be an element click trigger right now, but you need it to be a "custom event" trigger and you should have "ClickPrice" as the event name you use to trigger.
Like so:

Issue with Dynamic Remarketing Tag. The Product ID parameter is missing in 99% of the activity

When I go to Tag Google Ads details, I have this issue: "The “Product ID” parameter is missing in 99% of the activity of your Google Ads Tag".
Note, I implemented Dynamic Remarketing Tag via Google Tag Manager. In setting up Tag "Remarketing Google Ads" I inserted:
ID Conversion: XXX-XXX-XXX;
Custom Parameters: Use Data Layer {{google_tag_params}};
Trigger: All pages.
Following you can see source code html for a product page that contains ecomm_prodid, ecomm_pagetype, ecomm_totalvalue:
<!-- BEGIN: Google TagManager Remaketing -->
<script>
var dataLayer = window.dataLayer || [];
dataLayer.push({
'event':'remarketingTriggered',
'google_tag_params': {
'ecomm_prodid': '721',
'ecomm_pname': 'MAGLIONE GIROCOLLO IN LANA',
'ecomm_pcat': 'home',
'ecomm_pagetype': 'product',
'ecomm_totalvalue': '20.00'
}
});
</script>
<!-- END: Google TagManager Remaketing -->
So, I created in GTM a variable called google_tag_params with:
Data Layer Variable Name: google_tag_params;
Data Layer Version: Version 2.
As seen before, I used this variable in Remarketing Google Ads Tag, trying to capture at least: ecomm_prodid, ecomm_pagetype, ecomm_totalvalue needed to Display Remarketing.
When I use GTM in preview mode I have this:
Send dynamic remarketing event data: false
Variabile di livello dati:
{ecomm_prodid: '721',
ecomm_pname: 'MAGLIONE GIROCOLLO IN LANA',
ecomm_pcat: 'home',
ecomm_pagetype: 'product',
ecomm_totalvalue: '20.00'}
ID conversione: 'XXX-XXX-XXX'
Parametri personalizzati: 'DATA_LAYER'
Problem is issue "The “Product ID” parameter is missing in 99% of the activity of your Google Ads Tag" is still there.
I tried also check via Tag Assistant with Product Feed ID XXX-XXX-XXX, but I got this alert: Some products are not valid.
When I check on Metadata request in Tag Assistant I got this "event:gtag.config" and not parameters.
I searched for days on web, but did not find any solution.
Could you please assist me?
Thanks,
Francesco
Try the following:
Create a dataLayer variable for each of your dynamic remarketing variable.
google_tag_params.ecomm_prodid
google_tag_params.ecomm_pname
google_tag_params.ecomm_pcat
google_tag_params.ecomm_pagetype
google_tag_params.ecomm_totalvalue
Use the following custom event as you have in the dataLayer event field.
Use the manually specify on your AdWords tag:
Verify the implementation by checking in your browser network tab, filtering by the keyword random. You should see the dynamic remarketing request along with the key/value you've provided.

Facebook pixel trackcustom event showing undefined value set by Google Tag manager

I am managing my websites tags using Google Tag Manager. Following I have made in Google Tag manager
<script>
fbq('trackCustom', 'MyCustomEvent', { categoryname: '{{ecom_category}}'});
</script>
ecom_category is dynamically changing in Google Tag manager and showing correct value but in facebook pixel helper, it is showing categoryname "undefined". I am not getting any clue where and what should I check?
What could be the reason of showing undefined value in facebook pixel helper when it is correctly showing in Google Tag Manager.

Google tag manager preview and debug mode showing variables undefined

I am using facebook pixel with Google Tag manager. I have page view datalayer. I have made one custom tag for facebook like following
<script>
fbq('trackCustom', 'MyCustomEvent', { categoryname: '{{DL_ecomm_category}}'});
</script>
But now when I view in Google Tag manager preview and debug mode then it is showing variables undefined. I am attaching screen shot of variable and datalayer screen.
I am not getting what could be the reason? Is it problem in firing trigger or there should be custom data layer?

Universal Analytics tag with custom event and custom variables

I want to create a Universal Analytics tag (with enhanced e-commerce enabled) in Google Tag Manager, firing on custom event, ex.: uaEvent with two custom variables, ex.: uaVar1 and uaVar2.
I already created Data Layer Variables (uaVar1 and uaVar2) and the custom event trigger uaEvent in my GTM container. I'm pushing following data:
dataLayer.push({
'event': 'uaEvent',
'uaVar1': 'value',
'uaVar2': 'value'
});
and firing uaEvent on form submit.
Question
How should I configure my tag in Google Tag Manager container so that 'uaVar1' and 'uaVar2' will be visible and connected to uaEvent in Universal Analytics panel ?
Custom variables have been deprecated in Universal Analytics, so you should now use and configure Custom Dimensions under the Properties column in the GA interface. You will need to define the index and scope. Once you have done that, then for the tag that you want to associate your custom data with in GTM, you will need to specify, under the Custom Dimensions section of that tag, the name of the dataLayer variable for your particular Custom Dimension as well as the index.

Resources