How to enable ActiveCampaign Site Tracking for your Shopify store

You can use ActiveCampaign's site tracking code to track page visits made by contacts to your Shopify store.

Take note

We need to identify contacts so we can link their site visits to their email address in your ActiveCampaign account. We can identify them in the following ways:

Read more about ActiveCampaign's Site Tracking feature.

How to enable ActiveCampaign Site Tracking for 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 like the one below 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

Have more questions? Submit a request