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 "Settings," then click "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 "Settings,"  then click "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.

Click the link below for instructions on how to add Site Tracking to your Shopify 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 "Settings" in the left menu of your ActiveCampaign account.

2. Click "Tracking."

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

4. 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.

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

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

<script type="text/javascript">
</script>

7. 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.

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

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

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

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

12. Click “Upload asset.”

13. 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 }}

Note: 

'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.

14. 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:
Chrome
Firefox

Internet Explorer

Was this article helpful?
1 out of 4 found this helpful

Have more questions? Submit a request

Start free trial