Hello, I'm trying to send some data to Google Analytics using Adobe Data Collection. I'm using the Google Data Layer and Google Global Site Tag (gtag) extensions. The issue I have is that I'm not able to send items to GA.
Here is the code I'm using for testing:
window.onload = function () {
let productPage = window.location.pathname.includes("/product/");
if (productPage) {
gtag("event", "view_item", {
currency: "BRL",
value: 7.77,
teste: "teste",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1,
},
],
});
}
};
I'm using Google Data Layer extension in my Data Elements and Rules. Something like this:
Data Element:
Rule Event:
And then, from my rule, I use the gtag extension to send the data to Google Analytics.
Rule - action:
In Google Analytics I can see that the event and some values from the dataLayer are there, but I can't see items:
I'm not sure if I'm using the extensions correctly, specifically when I use the data element informing "items". Any help is appreciated.
Solved! Go to Solution.
Views
Replies
Total Likes
Take a look at Acronym's documentation for tracking ecommerce data with their Google Site Tag extension: https://docs.acronym.com/analytics/adobe-launch/gtag/faq#ecommerce
Views
Replies
Total Likes
Check that your "Product | Items" data element is getting an expected value. In your same rule, add a Custom Code action with this code:
console.log(_satellite.getVar("Product | Items", event));
If it's successful, you should see your "items" array in your browser console when your rule is triggered.
Views
Replies
Total Likes
It doesn't show anything in my console. But when I change the dataLayer to this:
window.onload = function () {
let productPage = window.location.pathname.includes("/product/");
if (productPage) {
dataLayer.push({
event : "view_item",
currency: "BRL",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 9.99,
quantity: 1,
},
]
})
}
};
My console show the values from those keys:
But I still don't see items in GA when I check the view_item event.
Views
Replies
Total Likes
Take a look at Acronym's documentation for tracking ecommerce data with their Google Site Tag extension: https://docs.acronym.com/analytics/adobe-launch/gtag/faq#ecommerce
Views
Replies
Total Likes
I was checking the values from items in the wrong place. In DebugView I can see that the values from items are there, after some time the Monetization reports started getting the item name dimension as well.
Thanks for your help yuhuisg! I still have to get used to GA
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies