Google Ads purchase conversion not firing

Highlighted
New Member
4 0 0

Hi there

I've followed this guide: https://www.digitaldarts.com.au/google-ads-conversion-tracking-shopify to attempt to get a Google Ads conversion event firing upon purchase. I put the below code in checkout under additional scripts:

 

{% assign UA-ID = "(redacted)" -%}{%- comment -%}Google Analytics tracking ID.{%- endcomment -%}
{%- assign AW-ID = "(redacted)" -%}{%- comment -%}Google Ads conversion ID.{%- endcomment -%}

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ UA-ID }}"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', '{{ UA-ID }}', { 'send_page_view': false, 'custom_map': {'dimension1': 'ecomm_prodid', 'dimension2': 'ecomm_pagetype', 'dimension3': 'ecomm_totalvalue'} });
gtag('config', '(redacted)');
</script>

<!-- Event snippet for Google Ads purchase -->
{% if first_time_accessed %} 
<script>
  gtag('event', 'conversion', {
    'send_to': '(redacted)/(redacted)',
    'value': {{ checkout.subtotal_price | money_without_currency | remove: ',' }},
    'currency': '{{ order.currency }}',
    'transaction_id': '{{ order.order_number }}'
  });
</script>
{% endif %}

 

This has stubbornly refused to be verified in Google over several weeks and manual tests in "test" mode.

When I asked a friend who is more technical than I am to look at it, he said:

"Your transaction ID seems to be pointing to an object that doesn't exist. It should be window.Shopify.checkout.order_id. 

Use the variables:

window.Shopify.checkout.order_id
window.Shopify.checkout.currency
window.Shopify.checkout.subtotal_price"

But the whole point of using Shopify variables is that this takes care of it, isn't it? Those values should be inserted into the placeholders when someone hits the checkout page. Right?

What am I missing here? I could replace the values with the values above but I feel Shopify has an easier way.

Thanks!

 

 

0 Likes