Setting Up the Google AdWords Dynamic Tracking Pixel in Shopify

Have you ever seen those ads that populate when you type something into a search bar? For instance, when I type the word “magento partner” into the Google search bar, here’s what happens:

magentopartner-blog1


The arrows are pointing to ads purchased on Google AdWords. Using AdWords enables advertisers to rank for their targeted search terms. Many companies invest a vast portion of their marketing budgets into it. But how do you get the most out of an AdWords investment for your Shopify site?

We recommend using a tracking pixel. Tracking pixels are snippets of code that allow you to track user behavior on your site. You can track the number of Google AdWords clicks you’re getting in relation to your total volume of sales with the Google AdWords Dynamic Tracking Pixel. Then you can use that information to measure and strengthen your Pay Per Click strategy. Remember, you can’t manage what you can’t measure.

Below, I’ll walk you through setting up the Google AdWords Tracking Pixel for Shopify.

If you’re a current or potential Gauge client, we will gladly help you with the setup process. To learn more or to pick our brains, feel free to Contact Us for assistance.

Step #1: Get your code snippet from AdWords.
(If you don’t have an AdWords account, go to adwords.google.com to create one.)

First you’ll need to sign up to track conversions, and you’ll need to create the conversion standards yourself. To do that:

A.) Log in to your Google AdWords account, and from the top menu select Tools → Conversions.

image04

B.) In the Conversion Actions section, click on the + CONVERSION button. If conversions are already enabled on your account, you’ll see a list of conversions that have been previously set up on your account instead.

image16


C.) That will take you to this page. Click on the Select button under the Website bucket.

image17

D.) Next, enter a name for the conversion you want to create. For clarity’s sake, I recommend using the type of conversion you are tracking in the name, like “AdWords Conversions” or “Product Listing Ads Conversions.” In this example, I’ve used the generic term “Conversion Name,” but you’ll want to pick something more specific. Then click Done. 

image10

E.) Now it’s time to set the value parameters for your conversion tracking. In the first window, click the second button in the Value section, and enter “$1.00” as the conversion value. Then click Done.

When you select a conversion value, you are telling AdWords to assign a value of $1.00 to the click, only if it does not register a different order value. The purpose of this post is to show you how to register conversions dynamically—meaning they’ll change with the cart totals. I’ll show you how to go into the code and change this in Step #3.

adwords conversion shopify
image14

F.) This next section gives you two options for counting your conversions. Choose between All or Unique. I recommend using the “All” selection because it will properly give credit to 3 individual orders from 3 different sessions.   This would work for a customer that frequents your site more than once.  Then click Done.

image18

G.) Next you’ll choose the conversion window you want to track. The Conversion Window refers to the actual click; View-Through Conversion Window refers to instances when a customer sees your ad on a search results page and does not click through immediately, but later visits your site. This gets a bit tricky. The most common time frame is 30 day conversion/30 day view-through, but you can limit them to whatever you consider to be a proper timeframe. Once you’ve chosen, hit Done.

adwords shopify
image11

H.) On the next page, choose which category of conversion you wish to track. Select Purchase/Sale.

image09

I.) The optimization setup allows you to determine whether AdWords will bring this data into your reports. There is no big reason not to do this, so select the check box and hit Done.

Optimization shopify

J.) Then, click Save.

adwords shopify setup

K.) Now you should be on the Settings page. Scroll down and you will see your code inside a text box:

image05

I.) This is your tracking code. Copy your own tracking code (not the one above) to your clipboard, and you’re ready for Step #2.

Step #2: Inserting the tracking code

Now I’ll show you how to insert your AdWords code snippet into the “Thank You” page of your site, where it can track how many customers click on your ad and purchase something from your shop.

Important Note: Sales can only be tracked if a customer visits the “Thank You” page after a transaction is completed. There’s no way to track purchases made using an offsite/third-party payment gateway if the customer does not return to Shopify afterward. This is hit-and-miss, and unfortunately, there’s nothing we can do to help with that. That’s why we suggest using one of the payment gateways offering full Shopify integration—the customer will always visit the “Thank You” page once their transaction is completed.

A.) Go to the Admin section of your Shopify store and click on Settings.

image02

B.) Click Checkout.

Shopify adwords setup

C.) Scroll down to the Order Processing section.

image01

D.) In the Order Processing section, locate the Additional Content & Scripts editable text box. Sometimes the box is really tiny and you can scroll right past it, but it’s there above the Checkout Language section.

image06
shopify adwords setup

E.) Once you’ve found it, paste the code snippet you created in Step 1.

F.) After pasting the code, click Save.

image07


Step #3: Altering the Google code snippet to provide real data

Before we get started, let’s clarify the meaning of each Google conversion.

  • google_conversion_id: This is an unique value that allows Google to identify the advertiser receiving the conversion.
  • google_conversion_value: This is a numeric value defined by the advertiser equaling the value of the conversion.
  • google_conversion_label: This is the type of conversion that occurred (purchase, signup, page view, or lead).
  • google_conversion_language: This is the language of the conversion tracking Google Site Stats text that appears on your website.

A.) Change the following code:

var google_conversion_value = 1;
image19

To this code:

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

If you want to include the taxes and shipping in the conversion amount, use the code below. It should look like this:

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

shopify adwords setup

B.) The <noscript> tag also must be taken care of, since the <noscript> tag defines an alternate content for users that have disabled scripts in their browser, or have a browser that doesn’t support scripts.

The content inside the <noscript> element will be displayed if scripts are not supported or are disabled in the user’s browser.

Then you need to replace the following in the pixel tracking URL:

value=1

With:

value={{ subtotal_price | money_without_currency }}

Or this:

value={{ total_price | money_without_currency }}
shopify adwords setup

It should look like this:

Be careful to not grab/overwrite more than you need, and don’t overwrite the question mark “?”.

That should do it. If you need any more help, don’t hesitate to contact us. And remember, Gauge Interactive is a full-service agency providing web design, development, and digital marketing strategy. We’d love to partner with you.

Like this article? Sign up to receive exclusive eCommerce news, advice, and industry content.