Help: Automation

Looking for training?  Join a webinar or schedule a one-on-one to go over ActiveCampaign & your marketing strategy!

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 “Integrations” tab and click “Site & Event 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 = ‘email@domain.com‘;
var trackcmp = document.createElement(“script”);
trackcmp.async = true;
trackcmp.type = ‘text/javascript';
trackcmp.src = ‘//trackcmp.net/visit?actid=279033&e=’+trackcmp_email +’&r=’+encodeURIComponent(document.referrer)+’&u=’+encodeURIComponent(window.location.href);
var trackcmp_s = document.getElementsByTagName(“script”);
if (trackcmp_s.length) {
trackcmp_s[0].parentNode.appendChild(trackcmp);
} else {
var trackcmp_h = document.getElementsByTagName(“head”);
trackcmp_h.length && trackcmp_h[0].appendChild(trackcmp);
}
</script>

How to use your site traffic data:

  • Automated series
  • Segments
  • Personalization
  • Conditional content

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 “Integrations” tab and click “Site & Event 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, “https://trackcmp.net/event”);
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
Connect