How to enable ActiveCampaign Site Tracking for your Shopify store

You can track page visits made to your Shopify store with ActiveCampaign Site Tracking. Doing so lets you create automated workflows based on visits to your store.

Take note

What is Site Tracking?

Site tracking shows you which identified contacts visited pages on your website. You can track visits by adding a snippet of Site Tracking code to your site and whitelisting your domain. Every ActiveCampaign account comes with its unique Site Tracking code. 

As identified contacts visit your site, those page visits are synced to your ActiveCampaign account. This data appears on Contact Profile records and in the Floating Segment Builder.  

How contacts are identified

We need to identify contacts to link their site visits to their profile records in your ActiveCampaign account. We identify contacts in the following ways:

  • A contact submits a form you created in ActiveCampaign. The form must redirect the contact to a page on your site with Site Tracking code installed 
  • A contact clicks a link in a campaign or automation email that takes them to a page on your site with Site Tracking code installed
  • You pass the contact's email address into the site tracking javascript code

Read more about ActiveCampaign's Site Tracking feature.

How to add Site Tracking to your Shopify Store

There are two ways to add Site Tracking to your Shopify store. How Site Tracking is added to it depends on when you connected your Shopify store to ActiveCampaign.

Connections made on or after April, 27, 2021

Once you connect Shopify with ActiveCampaign, you will be asked to install the ActiveCampaign CX Automation app in your store. Once this app is installed, we will:

  • Automatically add Site Tracking code to your Shopify store
  • Automatically whitelist your domain (your Shopify store URL) in your ActiveCampaign account

To see your whitelisted domain in your ActiveCampaign account, click "Website" > "Site Tracking." 

Turn off Site Tracking

You can turn off Site Tracking for your Shopify store at any time. To do so, log into your ActiveCampaign account. Click "Website" > "Site Tracking." Once you're on the Tracking page, uncheck the "Site Tracking" box next to your whitelisted domain.

Note that you can also click the "Enable" toggle in the Site Tracking box to set it to the "Off" position. However, this will turn off Site Tracking for all whitelisted domains in your ActiveCampaign account.

Connections made before April 27, 2021

If you connected your Shopify store to your ActiveCampaign account before April 27th, 2021, you need to manually whitelist your domain and add Site Tracking code to your store.

Note that the ActiveCampaign Support team cannot help you troubleshoot any issues with your Shopify theme or setup. For assistance with troubleshooting issues with your Shopify theme, please visit Shopify's "Support for themes" page

How to manually add Site Tracking to your Shopify store

1. Click "Website" > "Site Tracking" on the left menu. 

2. Click the "Enable" toggle to set it to the "On" position. This is located in the Site Tracking box.

3. Add your domain to your whitelist by typing it into the "Add Website URL" field and clicking the "Add" button. 

The domain you are adding is your store URL.

Note that you can uncheck the Conversations box if you are not using the Conversations feature.

  Conversations is no longer available for purchase to new customers as of January 3, 2023.

4. Copy the site tracking code from the Tracking Code box and paste it into a new text file.

5. Remove the following two Javascript tags from the code in your txt file:

<script type="text/javascript">

6. Save your text file as plain text and make sure it uses a JS extension.

Note that TextEdit on Mac uses Rich Text by default. You'll need to convert the TextEdit file from Rich Text to Plain Text.

7. Log into your Shopify store. Select “Online Store” then “Themes” on the left menu.


8. Click “Actions” from the dropdown, then click "Edit Code."


9. Click “Assets” then select “Add a new asset.”


10. Click the "Choose File" button to select the javascript file you just created on your hard drive.

11. Click “Upload asset.”


12. Go to "Layout" toward the top of the Themes page and click “theme.liquid.” Within the head section, add the following:

{{ 'ActiveCampaign_Tracking.js' | asset_url | script_tag }}


'ActiveCampaign_Tracking.js' is an example file name. You will need to insert your own JS file name here. Make sure to include your file name in all layouts.

13. Click "Save" when finished.

Advanced: Verify that site tracking was successfully installed

To verify that you have successfully installed the site tracking code into your Shopify store, go to your store's public page. Then, open your developer tools*. The developer console will open and you will see a page with your JS file that you added and the ActiveCampaign tracking code.

*Links to help you locate your browser's developer tools:

Internet Explorer

Was this article helpful?
3 out of 6 found this helpful

Have more questions? Submit a request

Start free trial