What's your biggest current challenge? Have your say in Community Polls along the right column.

Adding multiple google tags to Shopify

Adding multiple google tags to Shopify

bryanquek
Tourist
17 0 1

Hello, my site currently has a few Google tags installed. I'm trying to add one more tag from another Google Ads account but Tag Assistant is not able to detect. 

The Google&YouTube app is currently connected to another Google tag so I'm only able to add via editing the theme.liquid code. 

I'm trying to add the tag for AW-11039631640 and I added the code that is bolded and underlined.

   <!-- 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='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WFWTWP8Q');</script>
<!-- End Google Tag Manager -->
    
{% comment %}     <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Y4N9H559KT"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-Y4N9H559KT');
</script>{% endcomment %}

    <!-- Google tag (gtag.js) --> 
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-Y4N9H559KT"></script> 
    <script> window.dataLayer = window.dataLayer || []; 
      function gtag(){dataLayer.push(arguments);} 
      gtag('js', new Date()); 
      gtag('config', 'G-Y4N9H559KT'); 
      gtag('config', 'AW-709214926');
      gtag('config', 'AW-16714936365');
      gtag('config', 'AW-11039631640');
      {'allow_enhanced_conversions':true});
    </script>
   
<!-- Event snippet for Thank You Page conversion page, TMT tag -->
<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-16714936365/IGHECIvk8t0ZEK3gpqI-',
      'value': 1.0,
      'currency': 'SGD',
      'transaction_id': ''
  });
</script>
   
<!-- Event snippet for  - Purchase conversion page, Tag -->
<script>
  gtag('event', 'conversion', {
      'send_to': 'AW-11039631640/QpLICOitt_AZEJjSjZAp',
      'value': 1.0,
      'currency': 'SGD',
      'transaction_id': ''
  });
</script>
Reply 1 (1)

Sam_Mahmud
Shopify Partner
265 11 14

Hi Bryanquek,

 

 

As your are looking to add multiple Google tags on your website, the best practice would be to use Google Tag Manager GTM. Using GTM you can install more than one google tag using the tag template. 

 

feel free to ask if you have any questions.


Thanks

 

Your COFFEE TIP! Can Create something incredible!
Require Assistance with website design or enhanced conversion tracking Via Google Tag Manager GTM ?
sam.analyst4@gmail.com! or WhatsApp!
Solved? accept it as solution with like