Google Ads , Remarketing & GTM Tracking problems including checkout (without Shopify Plus)

ChristianL
New Member
14 0 0

Hello Community,

I have read the entire help thread (https://community.shopify.com/c/Ecommerce-Marketing/Google-Ads-Conversion-Tracking-Help/m-p/476866...and tried the Shopify help as well as this excellent guide:
https://www.digitaldarts.com.au/google-ads-conversion-tracking-shopify

But I can't make the Tracking work properly. I would be very thankful if anyone can help me out! Or if even @Josh_Uebergang could take a look at it. Sorry for the lenghty questions, I hope I have provided all the information needed.

(Account numbers replaced with XXX)

1. Google Ads Conversion tracking is setup in the checkpout in "Additional scripts".

The Global site Tag gets identified by Tag Assistant if I remove {% if first_time_accessed %} and  {% endif %}

But the conversion code gets identified as a Remarketing Tag and asks for a feed ID?! I want to start with just targeting certain user groups, no dynamic remarketing via feed.


This is the code: 

 

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

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

 

<!-- Event snippet for Produktkauf conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-XXX/O0UBCI6y-aIBENTXlN0C',
'value': {{ checkout.subtotal_price | money_without_currency }},
'currency': '{{ shop.currency }}',
'transaction_id': '{{ order.order_number }}'
});
</script>



2. GTM does not work in checkout:
in Shopify I have put the Google Analytics Code in the Admin Configuration area (shows a non standard implementation in Tag Assistant) and the following code in the additional script field. It does work on normales pages but it does not show up in the checkout area (tested it on Order status page)

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXX');

 

If it's possible to get it to work would it be better to fire the adwords conversion  on the thank_you page?

3. Google Ads Remarketing
in Google Ads "Audience sources" it shows an active tag with event parameter. Is this enough to start remarketing?

Thanks a lot in advance!
Christian


Replies 5 (5)
Josh_Uebergang
Shopify Expert
1000 42 261

Hi Christian,

 

1. If tag assistant identifies the conversion tracking code as remarketing, ignore it. Sure it wasn't referencing other code though? Anyway, what you have looks right. You should also view the source code of an order status page to ensure your liquid variables are displaying as intended. There are some currencies for example, that use commas instead of full stops.

2. Run GTM in preview mode to test. Also check that te additional analytics javascript you're pasting is actually saved. Shopify have began disabling this section from stores and you have to contact support to edit. I'm guessing because many store owners are breaking their checkouts using bad code then crying to support.

 

3. You can start remarketing as you have Google Analytics setup, but the better option for performance if you have more than a couple of SKUs, is dynamic remarketing where you begin to show products based on what people view. For this, you need to setup custom code. There's a chapter towards the end in my Google Shopping book that shows you how.

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

Hello @Josh_Uebergang 

thank you so much for replying!
I have opened a order status page:
1. Tag Assistant says this:
The Global Site Tag is on green,  remarketing is shown (asking for feed id).
In source code, comma in EUR was shown - but I re-read your guide to replace the comma, now Tag Assistant shows the conversion code as a new tag. Hopefully it gets varified in Google Ads account, too! I guess this was my mistake.

2. As the checkout field is working for Global Tag/ Ads scripts, I tried to copy it additionally in the checkout field. 
Tag Assistant marks it as mistake:
<script> tag must not be included in a <div> .
GTM JavaScript code not found as a direct child of the <head> tag

If I remove the <script></script> like in the additional analytics field, the code gets shown in the frontend.
So if I got you right, I have to contact Shopify support to enable the additional Google Analytics field for checkout.

3. Thanks for your recommendation. Want to setup the other things correctly first, then I hope I can go on with detailed retargeting.

Josh_Uebergang
Shopify Expert
1000 42 261

Sounds like you got a few things solved from response.

 

I don't fully understand what you're saying with point two. You don't have to contact Shopify support to enable scripts to be added to the order status page. That is widely available to all stores. You do though in order to edit Online Store > Preferences > Additional Google Analytics scripts. In there, you'll want to paste the GTM code.

Run Google Shopping ads? Get the free definitive guide to Google Shopping for Shopify (no optin required): https://www.digitaldarts.com.au/google-shopping
VentureOne
Visitor
1 0 0
venture.PNG,
 
hi
 
i want connect google tag manager to my website https://ventureonerealtyllc.com/ , after creating google tag manager account i copied code to header.php
 
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
})(window,document,'script','dataLayer','GTM-BZZSQ00');</script>
<!-- End Google Tag Manager -->
</head>
 
<?php
$object_id      = get_queried_object_id();
$c_page_id      = Avada()->fusion_library->get_page_id();
$wrapper_class  = 'fusion-wrapper';
$wrapper_class .= ( is_page_template( 'blank.php' ) ) ? ' wrapper_blank' : '';
?>
<body <?php body_class(); ?> <?php fusion_element_attributes( 'body' ); ?>>
<!-- Google Tag Manager (noscript) -->
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
 
I put it correctly to header.ph file but i got error through tag assistant google chrom extension
 
GTM JavaScript code not found as a direct child of the <head> tag
 
 
 
please sombody help  what can i do??
 
thank you
Karola
Visitor
1 0 0

I'm sure you've realized by now this is not the correct forum for your question 😄

 

But in case anyone else sees your question:  to reconcile PHP and JS you need "literals".  Your code should look like this:

 

{literal}

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
})(window,document,'script','dataLayer','GTM-BZZSQ00');</script>
<!-- End Google Tag Manager -->
{/literal}
 
-- 
 
no need to use literals for the "noscript" part - don't ask me why, it just works without them!  Of course, the code first part of the code still needs to be in the <head> tag, and the <noscript> in the body.