All things Shopify and commerce
Return management just got easier! We’ve launched Customer Self-Serve Returns to all Shopify merchants. Click here to learn more!
Hello does anyone know how can I Exclude Shipping from Revenue?
I found this piece of code but doesn't work
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-xxxxxxxxx', 'auto');
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
"id": {{order_name|handleize}}, // Transaction ID. Required.
"affiliation": 'store name', // Affiliation or store name.
"revenue": {{order.subtotal_price|money_without_currency}},
"coupon": "{{ line_item.quantity }}",
"tax": "{{ order.tax_price|money_without_currency }}",
"shipping": "{{ order.shipping_price|money_without_currency }}",
"currency": "{{shop.currency }}"
});
{% for line_item in line_items %}
{% assign list_position = forloop.index + 1 %}
{% assign product_category = '' %}
ga('ecommerce:addItem', {
"id": {{order_name|handleize}}, // Transaction ID. Required.
"sku": "{{ line_item.sku }}",
"name": "{{line_item.title}}",
"list_name": "Search Results",
"brand": "Brand Name",
"category": "{{ line_item.product.collections[0].title }}",
"variant": "{{line_item.variant}}",
"list_position": "1",
"quantity": "{{ line_item.quantity }}",
"currencyCode": "{{shop.currency }}",
"price": "{{ line_item.line_price | money_without_currency}}"
});
{% endfor %}
ga('ecommerce:send');
User | RANK |
---|---|
68 | |
49 | |
36 | |
34 | |
29 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022