How to Setup Google AdWords Conversion Tracking in Shopify

Option 1: If you already track sales in Google Analytics, the quickest solution is to import your transactions as a conversion. See the alternative solution below.

Option 2: What this tutorial covers and involves editing the existing AdWords conversion code. You need to edit their code to accurately track sales – and I’ll show you how. This is the solution I use to help Shopify stores grow.

Follow this simple three-step tutorial to setup Google AdWords conversion tracking for your Shopify store:

1. Create your conversion in AdWords

1. In your AdWords account, click “Tools” in the top menu then “Conversions”:

Google AdWords conversion tab

2. Create a new conversion:

Google AdWords new conversion

Use the following settings for your conversion:

  • Name:Your name can be anything. I recommend you make it “Sales”
  • Value: “The value of this conversion action may vary (for instance, by purchase price)”
  • Count: “All conversions”
  • Conversion windows: “30-day conversion window, 30-day view-through conversion window”
  • Category: “Purchase/Sale”
  • Optimization: “Allow bid optimization for this conversion action”. This is easiest for new advertisers

3. Save to finish creating your conversion code in AdWords. Your code will look something like:

Now it’s setup right on the side of AdWords, you just need to configure your code then add to your Shopify store to finish setting up Google AdWords conversion tracking.

2. Configure the Conversion Code

Your code at the moment will look something like:

<!-- Google Code for Sales Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 992160322;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "s8NFCPLRsVsQwtSM2QM";
var google_conversion_value = 1.00;
var google_conversion_currency = "AUD";
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/992160322/?value=1.00&currency_code=AUD&label=s8NFCPLRsVsQwtSM2QM&guid=ON&script=0"/>
</div>
</noscript>

You can add this to your Shopify store, but I recommend you make some minor alterations to the code so the order value is passed to AdWords. In optimising your AdWords campaign, you want to improve it based on generated revenue, not just “this campaign got 10 sales versus the other with 30 sales”.

1. Replace the line:

var google_conversion_value = 1.00;

…with:

if ({{ subtotal_price }}) { var google_conversion_value = {{ subtotal_price | money_without_currency }}; }

This parses the value of the purchase without shipping and other taxes like GST.

2. Replace the line:

<img style="border-style: none;" alt="" src="//www.googleadservices.com/pagead/conversion/992160312/?value=1.00&currency_code=AUD&label=s8NFCPLRsVsQwtSM2QM&guid=ON&script=0" height="1" width="1" />

…with:

<img style="border-style: none;" alt="" src="//www.googleadservices.com/pagead/conversion/992160312/?value={{ subtotal_price | money_without_currency }}&currency_code=AUD&label=s8NFCPLRsVsQwtSM2QM&guid=ON&script=0" height="1" width="1" />

If you skip this step, sales that occur in web browsers that have javascript disabled will not be tracked. So do it!

3. (optional) If you want to include taxes and shipping, replace both mentions of “subtotal_price” with “total_price”:

if ({{ total_price }}) { var google_conversion_value = {{ total_price | money_without_currency }}; }

and

<img style="border-style: none;" alt="" src="//www.googleadservices.com/pagead/conversion/992160312/?value={{ total_price | money_without_currency }}&currency_code=AUD&label=s8NFCPLRsVsQwtSM2QM&guid=ON&script=0" height="1" width="1" />

3. Adding the Google AdWords Conversion Code to Shopify

1. Log into the admin section of your Shopify store.

2. Go to “Settings” > “Checkout”:

Shopify settings checkout

3. Under the field “Shopify additional content & scripts”:

Shopify additional content and scripts

Paste your updated AdWords conversion code, which will look like:

<!-- Google Code for Sales Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 992160322;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "s8NFCPLRsVsQwtSM2QM";
if ({{ total_price }}) { var google_conversion_value = {{ subtotal_price | money_without_currency }}; }
var google_conversion_currency = "AUD";
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/992160322/?value={{ subtotal_price | money_without_currency }}&currency_code=AUD&label=s8NFCPLRsVsQwtSM2QM&guid=ON&script=0"/>
</div>
</noscript>

4) Click “Save” in Shopify and you’re done! You will now start receiving conversion value data inside AdWords.

Alternative: Google Analytics Import

The above method will work with everyone. There is another way that requires you to use Google Analytics and have the correct configuration in it to track sales. This is my preferred method because you should have a great Google Analytics setup in Shopify. To check if you can use this method, you need to see your sales data in the “Conversions” section of your analytics:

Google Analytics enhanced ecommerce

If you see similar data going into your Google Analytics, you can import the transaction goal into your AdWords to setup tracking.

1. On the conversions page in AdWords, click on “Google Analytics”.

2. Click the checkbox for the “Transactions” goal for the correct property and click “Continue”.

3. For the value field, select “The value of this conversion action is managed in Analytics”.

4. Check “Use the currency provided with the value in Analytics”. Click “Done” just below then “Import goals” at the bottom.

Import Google Analytics goal into AdWords

Done. For further help to make sales in Shopify using AdWords, see my AdWords services for Shopify stores.

About Joshua Uebergang

Joshua Uebergang is founder and Head of Strategy at Digital Darts. He helps Shopify stores get more of the right visitors and convert them into sales. At 6'9", yes, he plays basketball. Get extra tips and tricks from him to build your ecommerce store by entering your email below.

Liked this article? Get more free Shopify guides:

Facebooktwittergoogle_plusmail

4 Comments. Leave new

Thanks for your article, it’s been really helpful 🙂
Just one issue I’m experiencing: conversions are being tracked by Adwords like twice the real amount… I have set the “{% if first_time_accessed %} -tracking code- {% endif %}” tags to avoid the code running again when the user comes back to visit the status page, but even doing that the issue persists… Do you know what could be wrong? We can’t take the information Adwords give us seriously to take campaigns decisions, it’s a real problem. Thanks for your help!

Reply

Mine is set up right according to your instructions, but no conversion data is being shown in Adwords (and there should be.) Initially, conversions were being attributed to “referral traffic” so I added the “checkout.shopify”, paypal, and my own domain, to the “referral exclusions list”, however still no conversions are being attributed to Adwords. I went back through my GA Import steps and all are set up as you outline. One note, I decided to change from “last click” to “first click” attribution just in case something about the click attribution is throwing off the tracking. Any thoughts?

Reply

I recommend last-click attribution for most campaigns. Changing of this setting should only be done for marketing goals rather than technical issues. Sounds like you are using an analytics import goal in which case you must go through my guide mentioned.

Reply

Thanks for this tutorial. But if I just pasted this code provided without some further edits it would be wrong correct? Just want to make sure, in step #2, with web browsers with javascript disabled. I can’t just paste that code provided here, without also making sure my conversion_id, conversion_label and conversion_currency match my original code provided by Google right?

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *