In Best Practices and Tips, Digital Analytics, Technical Tuesday

Have you ever been in a situation where you’re setting up pixels for a client or your own shop and they need you to help them set up a dynamic pixel for Google Ads in Shopify?

This can sometimes be a daunting task because of the many different versions of pixels that are available. You also have to know how the Shopify code will interact with the pixel to pull in the different variables for the conversions in the eCommerce transaction.

In this post I’m hopefully going to make this whole process easier for you.

1st: Add your Google Ads Pixel to the Theme.Liquid. See screenshot below:

Global Site Tag in Shopify Theme.Liquid

Adding the site tag to the theme.liquid will help to make sure that all the visitors that come to your site are cookied. This will allow you to attribute conversions back to Google Ads correctly.

2nd: Add the pixel below to your Checkout “Additional Scripts” area.

<!-- Google Code for Sales Confirmation Conversion Page -->

<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = YOUR ID HERE;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "YOUR LABEL HERE";
if ({{ subtotal_price }}) { var google_conversion_value = {{ subtotal_price | money_without_currency }}; }
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/YOUR ID HERE/?value={{ subtotal_price | money_without_currency }}&label=YOUR LABEL HERE&guid=ON&script=0"/>
</div>
</noscript>

Note that you’ll need to replace the “YOUR ID HERE” and “YOUR LABEL HERE” with your specific Conversion Pixel ID and Label.

That’s it! Now you don’t have to worry if you’ll be able to track conversions on your Shopify store with dynamic revenue variables associated to the pixel.





Recent Posts

Leave a Comment

Have any questions?

If you have any question, send us an email and we'll get back to you, soon.

Not readable? Change text. captcha txt