Update 1.05 – Nov 14th 2020: Script now put into WordPress head section for compatibility with new Active Campaign personalisation features (as yet untested, but it should work)
The Active Campaign Tracking Script plugin dinstalls the Active Campaign Tracking script to immediately start tracking contacts based on an email address passed in the URL parameters of any link clicked to get to the site.
For example, if someone visits your home page with the link email@example.com then the page visit (and any subsequent ones) will be tracked for the contact firstname.lastname@example.org in your Active Campaign account.
A good way to start tracking is to ensure that after opting in, your new signups are redirected to your thank you page with their email address in the URL parameters. For example, using Convertbox if you check the “Pass form value in url parameters” box then it will pass all the form fields including the email address automatically to the thank you page.
This is particularly useful for optin tools that use an API connection with Active Campaign (as most do).
With an API connection, Active Campaign doesn't start tracking the contact immediately. They need to click a link in an email to your site for tracking to start. With this method, tracking starts immediately.
Installing the Plugin
You can install the plugin by downloading it from the link below and uploading it to your site using the normal plugin upload feature.
Once you've uploaded it you'll need to go to the settings and put in your Active Campaign account id so that it can put that in the tracking script.
You can find that in the Settings > Tracking section on Active Campaign.
Make sure you have Site Tracking switched on and you've added the URL to the website you want to track into Active Campaign. Details of how to do that are in the Active Campaign help here.
Scroll down to the Tracking Code section and you can get the account id from the section of the Tracking Code that says vgo(‘setAccount','nnnnnnnnn'); as below:
nnnnnnnnn will be your account id in this case and you can put it into the relevant section in the plugin.
And that's it – the plugin should start working.
Do be aware that because the plugin uses an email address in the URL parameters to identify the contact to be tracked, if someone deliberately visits your site with the wrong email address in the URL parameters it will track them wrongly. Nothing is foolproof :)
There is a companion plugin which cleans up URLs to remove email and other parameters after processing. You can get that here.
This plugin is a gift given freely to the Active Campaign/Convertbox communities. There is no formal support provided with it. If you have any problems then message me on Facebook (you'll find me in the Active Campaign and Convertbox groups) but I can't guarantee I'll be able to help.
Finally, many thanks to Dave Wooding who updated the plugin to enable you to add your own account id.