SEO, AdWords, affiliates, advertising, and promotions
I'm trying to set up conversion tracking with Google tag manager, yet i cant seem to find the data layer variable that contains my total order value. When i head into my console on my thank you page to see my data layers, it doesn't show me anything related to the transaction. Anyone have a workaround for this?
Hi @madshj you have to manually add the datalayer object to your additional scripts.
Go to settings > checkout > additional scripts.
Frome there you can add a script to create a datalyer object and push a purchase event with all the relevant parameters.
e.g.
<script>
window.dataLayer = window.dataLayer || []; // this initializes the datalayer
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: "{{ checkout.name }}",
currency: "{{ checkout.currency }}",
value: {{ total_price | money_without_currency }}, // this is your total order value. Evaluate replacing decimal separator to dot notation
items: items //here you have to put your item array if you want to track the items that have been purchased.
}
});
</script>
If you need complete dataLayer you can check it. https://leomeasure.com/shopify-datalayer-gtm
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024