Active Campaign Site Tracking and Triggers

Active Campaign Site Tracking and Triggers javascript

What is Active Campaign?

Active Campaign is a “customer experience automation” service that features email marketing, marketing automation, sales automation, and customer relationship management. The service offers a free and paid tier to the users then later offers/unlocks more features that can be used by its users. Here are the FREE feature and functionalities offered:

  • Newsletters
  • Email Marketing
  • Marketing Automation
  • Website Tracking
  • Unlimited sending of emails

 
Related Content

 

 

For this documentation, we will focus mainly on email marketing, marketing automation, and how the service can be integrated into a WordPress site. We will use the free-tier plan to check on what’s included right out of the box.

 

Automation Workflows in Active Campaigns

Newsletter Automation Workflow in Active Campaigns

 

Figure 1 – Newsletter Automation Workflow in Active Campaigns

Active Campaigns Automation workflow is very similar to SendInBlue’s automation workflow with a flowchart style where at the top is the starting point of the workflow going down until the workflow ends. The sample workflow above is a newsletter being sent to the user once they have been in a contact list. The great thing about Active Campaigns is that it supports the sending of email series in free users. Meaning, we can send multiple emails to the subscribers of that list even if we’re only using the free-plan.

Built-In Triggers

Behaviors and Actions:

 
Open/ reads an email
 
clicks a link in an email
 
Web page is visited
 
Event is recorded
 
Shares an email
 
Forward an email
 
Replies to an email
 
Tag is added
 
Tag is removed
 
Field changes
 
Dismisses a site message
 
Makes a purchase
 
Abandons cart
 
Score changes
 
 

eCommerce Events:

 

Web page is visited

Goal is achieved

Conversion occurs

Makes a purchase

Abandons cart

Score changes

Deal state changes

 

Active Campaign Event and Site Tracker

Active Campaign offers two trackers where you can trigger your own custom events if the scenario you want is not listed in the pre-made triggers. Active Campaign Tracker can be installed without any use of endpoints/POST calls. Instead, we can install the tracker with the use of a JavaScript code generated for us. The JavaScript code is only meant for the Site Tracker. Implementing the Event Tracker requires:

Site Tracker

Covers/tracks pages visited by users. Uses a JavaScript code for tracking the activities made by users. 

Event Tracker

Tracks events in webpages like button click made by users. Uses a PHP code for tracking the activities made by users.

The event tracker on the other hand uses PHP for generating its events. Below is a sample code for generating the event

$curl = curl_init();       curl_setopt($curl, CURLOPT_URL, "https://trackcmp.net/event");  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);     curl_setopt($curl, CURLOPT_POST, true);     curl_setopt($curl, CURLOPT_POSTFIELDS, array(

     "actid" => "ACTID",

     "key" => "APIKEY",

     "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);

     }

Implementing Active Campaign in WordPress

Active Campaigns offers an official plugin for WordPress. The official plugin offers Active Campaign forms and even site tracking. Below is the procedure for installing Active Campaigns.

Things to take note:

  • This documentation will be focusing on Active Campaign and WordPress. For this implementation, we will be installing the official plugin offered by Active Campaign

Procedure:

  • Install the Active Campaign Plugin for WordPress
  • Connect your Active Campaign account in WordPress using your API URL and API key. API URL and API key can be found in Active Campaign’s Settings > Developer Section

If you want to enable Active Campaign’s site tracker, follow the procedure below. This documentation will also tackle the tracker in the next chapter.

  • In Active Campaign’s settings, select Tracking. Make sure you turned on Site Tracking and Event Tracking.
  • Go back to WordPress and visit the plugin settings for Active Campaign. Make sure that the “Install Active Campaign Code” is turned on.
  • Press on Update Settings

From there, we can create our first Active Campaign form and have it embedded in the WordPress site.

Make sure you’ve already created a contact list before creating a form! It will be used for storing the person’s details. To create a form, simply visit the forms page on the Active Campaigns page. Create a form there and make sure that form adds the user to a contact list.

Sample newsletter form
Sample newsletter form

Above is a sample form we’ve created. Once you’re done customizing your form, go back to WordPress and open the settings page for Active Campaign. There should be a preview of the form we’ve created as well as the short code for implementing the form on the website.

Subscription Forms

To embed the form, simply copy the provided short code and paste it at the desired page. We’ve used Elementor to embed the form in a page.

Newsletter sample

We have now implemented the form! All we have to do now is to set up the automation workflow. The workflow should send an email to the user about the form they’ve signed up!

To create an automation workflow, press on the Automations page, then press the Create an Automation button.

Workflow for the newsletter form
Workflow for the newsletter form
 

The highlighted words are parameters. Therefore, you’ll have to change the value in each parameter for the PHP code to work.

  • Act ID – This can be found at the Developers page in Active Campaign.
  • API Key – Can be found at the Developers page as well.
  • Event – The name of the event. The name of the event will be used for triggering an automation workflow.
  • Event Data – Data that will be passed through in the event.

To use the event in the automation workflow, make sure you’ve added the name in the whitelist first. This can be done at Tracking Settings page of Active Campaign.

Event Tracking

Once you have added the event name in the whitelist, we can now trigger a workflow by the event API. 

Action options

Select the name of the event you’ve added in the whitelist and you’re done! You’ve made a workflow using the Event Tracker. The event can be triggered by the PHP code provided above. The code can be placed on the website with a PHP file. The code is guaranteed to work as long as you’re main site is in PHP format.

For the Site Tracker, since it focuses mainly on tracking the pages visited by the user, we can select “Web page is visited” as the trigger.

Action options

From here, we can select what page of the website will be used for triggering the workflow.

Based on the figure above, two triggers have been added for starting the form. The reason why there are two triggers is to make sure that the user will receive the email when: they’ve signed up in the form and/or been added in the newsletter list.

Make sure you’ve marked the workflow as active in order for it to work! Once done, we can simply test out the form.

Message after using the form we’ve created
Message after using the form we’ve created

Once the user used the form, they should receive an email confirming the subscription. Below is a sample image of the subscription confirmation.

Thank you message

After pressing the “Confirm My Subscription” button, the automation we’ve created should start. The user should receive the email below.

Email Sample

And that’s it! We have triggered a workflow using the form we’ve embedded in a WordPress site! There are more ways to trigger a workflow like clicking an email, user attributes like birthdays, etc. This chapter mainly the basics for triggering a workflow. The next chapter talks about custom events/site tracking for triggering an automated workflow.

 

Conclusion

After the documentation, we have learned the following:

  • Features available for the free-tier plan of Active Campaign.
  • How Active Campaign’s automated workflow works.
  • Implementation of Active Campaign’s forms into WordPress with the use of an official plugin offered by the Active Campaign.
  • Active Campaign’s Tracker and its Event API

Active Campaign offers a lot of features for its free-tier plan. While its UX/UI for its dashboard is a bit overwhelming because of the number of functionalities shown. Also, the separation of event tracking and site tracking (with different languages: PHP is used for event tracking, JavaScript is used for site tracking) makes its implementation for your websites a bit more complicated. Active Campaign is a good marketing service if you are willing to learn how its features and functionalities work. 

Share:

More Posts

Send Us A Message

Read more