ActiveCampaign Site Tracking

This Article Applies to

Automatically creates and configures your tracking script for ActiveCampaign

Automatically detects when your users are logged in, and tracks them

Automatically disables tracking when no trackable information is found

Site & Event Tracking

Site tracking

With site tracking you can place a small snippet of javascript on your site (similar to Google Analytics) and we will log/track all of your site traffic.  You can selectively include an email address as part of the javascript (on form completion pages, shopping carts, when users are logged in, etc..) and we will relate all of their past & future traffic on your site to that email address.

How to setup site tracking:

  1. Go to the “Settings” tab and click “Tracking” in the side menu
  2. Click “Enable” by the “Site Tracking” section
  3. Add your domain(s) to the domain white list
  4. Copy/paste the tracking code on to your web site

Example code that you paste on your site:

<script type=”text/javascript”>
var trackcmp_email = ‘‘;
var trackcmp = document.createElement(“script”);
trackcmp.async = true;
trackcmp.type = ‘text/javascript’;
trackcmp.src = ‘//’+trackcmp_email +’&r=’+encodeURIComponent(document.referrer)+’&u=’+encodeURIComponent(window.location.href);
var trackcmp_s = document.getElementsByTagName(“script”);
if (trackcmp_s.length) {
} else {
var trackcmp_h = document.getElementsByTagName(“head”);
trackcmp_h.length && trackcmp_h[0].appendChild(trackcmp);

How to use your site traffic data:

  • Automated series
  • Segments
  • Personalization
  • Conditional content

NOTE: We automatically track site visits as soon as you install the code on your site, activate site tracking from your account, and whitelist the tracked domains. In order for us to match the site visits, one of the following needs to happen.

  1. The contact would need to subscribe through an ActiveCampaign form
  2. The contact clicks a campaign link that takes them to a tracked page


Event tracking

With event tracking you can log events such as sign ups, orders, actions within your application, etc… With each event that you log you can specify the email address, an event name, and an event value.  The event name and value can be anything you want.  You can then use event data to help run automations, personalize campaigns, show conditional content, trigger campaigns, etc..

How to setup event tracking:

  1. Go to the “Settings” tab and click “Tracking” in the side menu
  2. Click “Enable” by the “Event Tracking” section
  3. Copy/paste the event tracking code on to your web site
  4. Be sure to update the event name and event data variables in the tracking code

Example code that you paste on your site:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, “”);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, array(
“actid” => 23033,
“key” => “c12973b078007927842301eff932e7d78b74b3e”,
“event” => “YOUR_EVENT“,
“eventdata” => “ANY_DATA“,
“visit” => json_encode(array(
// If you have an email address, assign it here.
“email” => “”,

$result = curl_exec($curl);
if ($result !== false) {
$result = json_decode($result);
if ($result->success) {
echo ‘Success! ‘;
} else {
echo ‘Error! ‘;

echo $result->message;
} else {
echo ‘CURL failed to run: ‘, curl_error($curl);

How to use your site traffic data:

  • Automated series
  • Segments
  • Personalization
  • Conditional content

Related Posts:

9 ways to add more value to your membership site

Table of Contents

This Article Applies to

Related Posts

Site Lock

When enabled, this setting requires that the user be logged in prior to viewing any pages on the site. Any attempt to view any page without being logged in, will cause the user to be redirected to the login page.

Read More »

Integrating LifterLMS with ActiveCampaign using Memberium

Memberium’s integration with LifterLMS makes it easy to protect and sell courses through ActiveCampaign. LifterLMS does have built-in course protection, but its lack of integration with ActiveCampaign makes it impossible to sell the course and automatically grant access to it using ActiveCampaign. That’s where Memberium comes in.

Read More »

Ready to See How You Can Automate Your Course or Membership With Memberium for ActiveCampaign?

Watch this quick demo video to see how Memberium works. Discover how thousands of successful business owners use Memberium to sell their membership programs and how you can too! If you’re ready to get started, you can check out our plans and pricing here…