We use this code format in google analytics corresponding to add to cart feature of google analytics.
function addToCarts() {
ga('ec:addProduct', {
'id': '12334',
'name': 'methyly methly',
'category': 'Clothing',
'brand': '',
'variant': '',
'price': '100',
'quantity': 40
});
ga('ec:setAction', 'add');
// send this using event
ga('send', 'event', 'enhanced ecommerce', 'button click', 'add to cart');
}
addToCarts();
Where in google analtics convertion tab----->Enhanced ecommerce i can see quantity of product added?.Their is one section in google analytics conversion---->Enhanced ecommerce--->shopping behaviour--->Products add to cart(metric). But it only reflect how many times product was added to cart but not how many qunatity of that product to cart.
You can find the quantity in Summary tab of the report: Conversions-->Ecommerce-->Product performace (Summary tab).
Related
This is code for add to cart in enhanced ecommerce feature of google analytics.
function addToCarts() {
ga('ec:addProduct', {
'id': '12334',
'name': 'methyly methly',
'category': 'Clothing',
'brand': '',
'variant': '',
'price': '100',
'quantity': 40
});
ga('ec:setAction', 'add');
// send this using event
ga('send', 'event', 'enhanced ecommerce', 'button click', 'add to cart');
}
addToCarts();
This is reflected in Conversions-->Ecommerce-->Product performace's Add to cart metrics.
Please see attached image.
Here i am setting default value of quantity to 40 but still 'Products Add to cart' metrics only increments it by 1 in google analytics.
Just to confirm that 40 quantity is sent or not i checked from developers tool and quantity is sent 40 only but still in google analytics 'Products Add to cart' metrics only increments it by 1 in google analytics.
Yes, I confirm that that column indicates the number of times the product was added to the shopping cart, not the quantity of product added to the cart. You can find the quantity in Summary tab of the same report.
I'm implementing enhanced ecommerce in Google Analytics and I have a problem.
When the purchase of a product is made, it's redirected to a thanks page and that's where the Purchase event is sent to Analytics.
ga('require', 'ec');
ga('set', 'currencyCode', 'EUR');
ga('ec:addProduct', {
'id': 'prueba-001',
'name': 'Prueba',
'brand': 'Prueba',
'category': 'Prueba',
'variant': 'Prueba',
'price': 10.50
});
ga('ec:setAction', 'purchase', {
'id': 't-prueba-01',
'revenue': 5.50
});
ga('send', 'pageview');
The 'purchase' event is recorded perfectly, but the addProduct event is not quite right, the unique purchases of each product are registered but nothing else.
I don't know what else to do, I have followed the steps in the documentation and the problem persists.
Edit:
Sales report
Try to use quote for price and revenue (for consistency with the documentation) and above all add the quantity parameter to the product.
I tried the follwoing code
ga('create', 'UA-111563164-2', 'auto');
ga('require', 'ec');
ga('ec:addImpression', { // Provide product details in an impressionFieldObject.
'id': 'trip-to-fairy-meadows-and-nanga-parbat-base-camp-by-directions-explore-with-us', // Product ID (string).
'name': 'TRIP TO FAIRY MEADOWS AND NANGA PARBAT BASE CAMP', // Product name (string).
'brand': 'DIRECTIONS - EXPLORE WITH US', // Product brand (string). // Product variant (string).
'category': 'Apparel/T-Shirts',
'variant': 'black',
'list': 'Search Results',
'position': 1
});
ga('ec:addImpression', {
'id': 'P67890',
'name': 'YouTube Organic T-Shirt',
'category': 'Apparel/T-Shirts',
'brand': 'YouTube',
'variant': 'gray',
'list': 'Search Results',
'position': 2
});
ga('send', 'pageview');
The code is written in angular 4 and i am using angulartics2 library. the data is not push toward to the google analytics.
Your code looks fine and should work as intended. The reason you are not seeing any data is likely because Google Analytics data processing latency.
Processing latency is 24-48 hours. Standard accounts that send more than 200,000 sessions per day to Analytics will result in the reports being refreshed only once a day. This can delay updates to reports and metrics for up to two days. To restore intra-day processing, reduce the number of sessions your account sends to < 200,000 per day.
For Analytics 360 accounts, this limit is extended to 2 billion hits per month.
More in Google Analytics official documentation: https://support.google.com/analytics/answer/1070983?hl=en
I need your help about GTM and UA.
Like this exemple i catch the Event in Google Analytics that's work fine :
// Measure the removal of a product from a shopping cart.
dataLayer.push({
'event': 'removeFromCart',
'ecommerce': {
'remove': { // 'remove' actionFieldObject measures.
'products': [{ // removing a product to a shopping cart.
'name': 'Triblend Android T-Shirt',
'id': '12345',
'price': '15.25',
'brand': 'Google',
'category': 'Apparel',
'variant': 'Gray',
'quantity': 1
}]
}
}
});
In Analytics i can catch the "Event" but where is products data ?
Thanks in advance for your help.
The products data is in the datalayer. You can set set the GA tag to read the dataLayer (alternatively you can set it to use an E-commerce-Variable containing the product data). This is just not very visible in the documentation, you need to click the little green arrow below the code example to expand the description of how to configure your tag (the example assumes you are using and event to send e-commerce data):
If you use a GA setting variable you might need to click "override settings" in the GA tag first.
I'm using Enhanced Ecommerce and I want to know how good my product lists perform. Below a screenshot of the product list performance section.
You can see that I've set up three lists:
productgroep default (Standard product listing)
productgroep filtered (Product listing with filters used)
detail view (this is actually a product detail page, so no listing.)
There is also a:
(not set) product list name, this one comes by default.
Now when I click on a product in a list, it counts in the column Product List Clicks, all fine.
One can also add a product directly to the cart when the list is shown, so these are also measured and shown in the column Product Adds To Card.
Now when the product is purchased, it counts the Product Checkouts, Unique Purchases and Product Revenue in the product List (not set).
When the product is added to the cart directly from a list, I also do:
ga("ec:setAction", "click", {
"list": "productgroep default"
});
Why doesn't GA add these purchases to the correct product list?
When product is clicked from list page, do:
ga('ec:addProduct', {
'id': id,
'name': name,
'category': 'Apparel',
'brand': 'Nike',
'variant': 'black',
'position': 1
});
ga('ec:setAction', 'click', {list: listName});
ga('send', 'event', 'UX', 'click', 'Results');
When the product is added to the cart directly from a list, do:
ga('ec:addProduct', {
'id': id,
'name': name,
'category': 'Apparel',
'brand': 'Nike',
'variant': 'black',
'position': 1
});
ga('ec:setAction', 'click', {list: listName});
ga('send', 'event', 'UX', 'click', 'Add to Cart Catalog');
On product details page load, do :
ga('ec:addProduct', {
'id': id,
'name': name,
'category': 'Apparel',
'brand': 'Nike',
'variant': 'black'
});
ga('ec:setAction', 'detail');
ga('send', 'pageview');
The attribution in the enhanced eCommerce is a little trick, it makes list attribution and promotion attribution.
Relate to the list attribution, the purchase is recursively attributed to the last list viewed that contains the id of the product. So, even if you access the cart through one page, f you open another page that contains the product id before making the purchase, the attribution will change. With the promotion attribution is kind of different, the purchase is attributed to the last promotion clicked.
Make sure of the structure of the enhanced eCommerce object as well.
There's a full explanation here. This blog has a lot of information about it.