Adwords Conversion Tracking

glengold
New Member
1 0 0

I have been doing research regarding Google Ads conversion tracking. I am running across a difference in opinions regarding implementation. An article provided by Shopify https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/tracking-adwords-conversion... states to add "{% if first_time_accessed %} and {% endif %}" however it is not being picked up on the backend. When I read article from the Shopify community people are having issues with including those rules in the script. I as well removed the scripts and see the script showing. The confusion I have is that this code is to minimize duplicating conversions. Why would I remove it if I don't want duplicate conversion. Was wondering what the true answer is? Also is the code included below written correctly?

 

<!-- Global site tag (gtag.js) - Google Ads: ########## -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-##########"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-##########');
</script>

<!-- Event snippet for Purchase conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': '##################',
'value': {{ checkout.subtotal_price | divided_by: 100.0 }},
'currency': 'USD',
'transaction_id': '{{ order_number }}'
});
</script>

or is this the right way

{% if first_time_accessed %}
<!-- Global site tag (gtag.js) - Google Ads: ########## -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-##########"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'AW-##########');
</script>

<!-- Event snippet for Purchase conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-##################',
'value': {{ checkout.total_price | money_without_currency | remove: ',' }},
'currency': 'USD',
'transaction_id': '{{ order.order_number }}'
});
</script>
{% endif %}

0 Likes

If you want to track purchases at checkout, then use:

{% if first_time_accessed %}...{% endif %}

After over 5 years managing many Google Ads accounts for Shopify clients, we have never encountered a reason to not keep it. Like you say, it doesn't make sense why you'd want to remove it.

The one exception is removing it temporarily to test values outputted in the code by reviewing an existing order, rather than submitting a new test order every time.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping