Skip to content

Commit

Permalink
update the price formatting
Browse files Browse the repository at this point in the history
gtm doesn't like the price in pence so over recording all the sales by magnitude of 100
  • Loading branch information
Joe Prisk authored Feb 13, 2017
1 parent 9b4f8d6 commit f4ea954
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tag-manager-include.liquid
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script>
dataLayer = [{
'transactionId': '{{ checkout.id }}',
'transactionTotal': {{ checkout.total_price }},
'transactionTax': {{ checkout.tax_price }},
'transactionShipping': {{ checkout.shipping_method.price }},
'transactionTotal': {{ checkout.total_price | money_without_currency }},
'transactionTax': {{ checkout.tax_price | money_without_currency }},
'transactionShipping': {{ checkout.shipping_method.price | money_without_currency}},
'transactionProducts': [
{% for item in checkout.line_items %}
{% if forloop.index > 1 %}, {% endif %}{
'sku': '{{ item.sku }}',
'name': '{{ item.title | handleize | replace: '-', ' ' }}',
'price': {{ item.price }},
'price': {{ item.price | money_without_currency }},
'quantity': {{ item.quantity }}
}
{% endfor %}]
Expand All @@ -30,4 +30,4 @@
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-XXXXX');</script>
<!-- End Google Tag Manager -->
<!-- End Google Tag Manager -->

0 comments on commit f4ea954

Please sign in to comment.