× Exclamation Point Icon Important: As we continue to evolve and improve our offerings, we have decided to retire the SharpSpring Ads (formerly Perfect Audience) platform on August 15, 2024. Click here to learn more.

Shopify (Manual Installation)

Sh*SharpSpring Marketing Automation Users: This article is not applicable if you are a SharpSpring Marketing Automation user*

This article will help you install our tag in your Shopify store only if you are unable to use our automatic installation. If you've already used the automatic process, you can disregard this page. If you were not advised to use these instructions by a support representative, please use the automatic installation above.

1. Installing the Tag

In your SharpSpring Ads account, select Manage-> User Tracking.


This will pull up a page with a javascript tag that looks like this:


Switch to your Shopify dashboard. Click Online store, then Themes.


Click Actions, then Edit Code

Under Layouts, select theme.liquid.

Scroll to the bottom of the code. Paste the site tracking tag just above the </body> tag.



Optional: If you plan to use dynamic ads with your Shopify store, you'll need to modify the line of code beginning with "_pa.product.Id" in the site tracking tag. Remove the // in this line and modify it to look like this:


Note: If you are using the Shopify App, Google Shopping, AND have an international store, you'll modify the line of code to look like this: 

_pa.productId="shopify_<input your specific country information>_{{product.id}}_{{product.variants.first.id}}";

Example of completed code: _pa.productId="shopify_nl-BE_{{product.id}}_{{product.variants.first.id}}";

Scroll to the top of the page and press Save. 

2. Setup Your Conversion Goal

Next, you'll need to add some code to track your conversions. In your Shopify settings, click the Checkout tab:

Then, in the Additional Scripts box, paste in this code:

<script type="text/javascript">
window._pq = window._pq || [];
_pq.push(['track', 'PurchasedItem', {orderId: "{{ order_number }}", revenue: ({{ subtotal_price }}/100)}])</script>

IMPORTANT: In addition to this code, you will also need to paste your regular site tracking tag found under Manage-> User Tracking in this box. This is the same tag that you installed in Step One of this guide.

Then Save. Back in SharpSpring Ads, click Manage-> Create Conversion. Use the following settings:

Then save the conversion goal. 

Wait for the e-mail! Now that your tag is on your Shopify store, you will receive an e-mail when our system starts seeing data. You can also check back to the Site Tracking Tag page to see if data is being received. This usually takes an hour or two. If you don't get an e-mail or see data on your tag page or Audiences page, double check that you've placed the tag in your web site code and pushed that code live. It can be easy to forget a simple step in there along the way.

If you no longer wish to track users or products from your Shopify store, follow these instructions to remove our app and code:

  1. Go to your Shopify Checkout settings, and look for the Additional Scripts box.
  2. Remove the conversion code you added previously (listed above) and save.
  3. In your Shopify Admin section, click Online Store, then Themes.
  4. Click Actions -> Edit Code. Select Layers -> theme.liquid (or the theme file you're using for your store). 
  5. Find the Perfect Audience code you added previously (listed above) and delete it. Then save your theme file.

This will remove all tracking and connection from SharpSpring Ads. 

If you have any problems, email ads@sharpspring.com