Skip to main content
All CollectionsDIY Guides & FAQsGeneral FAQs
FAQ: How do I install my Google Ads Remarketing tag for BigCommerce?
FAQ: How do I install my Google Ads Remarketing tag for BigCommerce?
Updated over 4 years ago

IMPORTANT: Installing your Google Remarketing Tag in BigCommerce will require access to your source code or Theme.

First, Navigate to Storefront > My Themes > Inside the current theme, click on Advanced > Edit Theme Files:

  • Click Edit Theme Files

  • Navigate to templates/components/products/product-view.html

REMEMBER : Change the XX-XXXXXXXXX three times with the value provided by Google Ads during all the following steps

At the bottom of the file, paste the following code:

<!-- Global site tag (gtag.js) - Google Ads Tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'view_item', {
    'send_to': 'XX-XXXXXXXXX',
    'value': '{{product.price.with_tax.value}}',
    'items': [{
      'id': '{{ product.id }}',
      'google_business_vertical': 'retail'
    }]
  });
</script>
  • Now navigate to : templates/components/search/heading.html

  • At the bottom of the file, paste the following code

<!-- Global site tag (gtag.js) - Google Ads Tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'view_search_results', {
    'send_to': 'XX-XXXXXXXXX'
  });
</script>
  • Now navigate to : templates/pages/home.html

  • At the bottom of the file, paste the following code

<!-- Global site tag (gtag.js) - Google Ads Tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'home', {
    'send_to': 'XX-XXXXXXXXX'
  });
</script>
  • Now navigate to : templates/components/cart/content.html

  • At the bottom of the file, paste the following code

<!-- Global site tag (gtag.js) - Google Ads Tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'add_to_cart', {
    'send_to': 'XX-XXXXXXXXX',
    'value': '{{cart.grand_total.value}}',
{{#each cart.items}}
    'items': [{
      'id': '{{product_id}}',
      'google_business_vertical': 'retail'
    }],
{{/each}}
  });
</script>

Checkout

This part differs slightly and you won't have to edit your template or any code.

  • Go back into your main control panel

  • Navigate to Advanced Settings > Affiliate Conversion Tracking

  • In the field box provided, paste the following code:

<!-- Global site tag (gtag.js) - Google Ads Tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=XX-XXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'XX-XXXXXXXXX');
</script>
<script>
  gtag('event', 'purchase', {
    'send_to': 'XX-XXXXXXXXX',
    'value': '%%ORDER_AMOUNT%%',
  });
</script>

 

Did this answer your question?