Like all online marketers, you want to know where your website visitors initially came from. The so-called referrer URL or source. Google Analytics uses this data to determine the medium, source, and channel. Examples are:

  • Search engines
  • Links from other websites
  • Social media
  • Online ads
  • Email marketing campaigns
  • Affiliate links
  • Links built into software

It is vital to know the source of your leads to determine which source delivers the best leads or most revenue. We call this referrer URL or source tracking, but this is currently not available in Act-On.

Till now! Below I will explain how to implement not only source tracking but also an improved version of UTM tracking in Act-On.

UTM tags are places at the end of a URL. By using hidden fields in an Act-On form the UTM data can be saved in Act-On. But the UTM tags are gone when visitors decide to browse your website before submitting the form. This is solved with this solution by storing the UTM tags in a cookie.

How does it work

The basis is a javascript solution from Terminus (you can read the details on https://github.com/). The original script was created for adding UTM and referrer information to lead forms. With some changes I got it working for Act-On. Below a short explanation of how it works:

  • You make adjustments to your Act-On form(s).
  • You place a javascript on every page of your website.
  • With every new visitor, the javascript creates a cookie in the visitor’s browser. The source (referrer) and other data is stored in this cookie.
  • When this visitor fills in an Act-On form, the values ​​stored in the cookie are passed on to the form and saved in Act-On.

Is this GDPR Proof?

When placing a cookie, the question naturally arises: Should we not request approval for placing this cookie? From my point of view, there is no need to request approval to place the cookie because the data in the cookie is only used when the user agrees to the processing of the data by submitting the form.

How is the data stored in Act-On?

The data is saved in the form submission list and can be used for further processing. The following data fields are available:

  • The five standard UTM parameters being utm_source, utm_medium, utm_campaign, utm_term en utm_content (field names: USOURCE, MEDIUM, UCAMPAIGN, UCONTENT, UTERM)
  • Initial Referrer – The URL from which the user came at the first visit (field name: IREFERRER).
  • Last Referrer – The URL from which the user came at the most recent visit (field name: LREFERRER).
  • Initial Landing page – The URL of the page the user entered on the first visit (field name: ILANDPAGE).
  • Number of visits – Number of visits to the website before the form has been completed (field name: VISITS).

In this blog, we focus on getting the Initial Referrer and Last Referrer stored in Act-On. The method for the other fields is the same.

STEP 1: The Act-On form

  • Create a new form or use an existing one.
  • Add 2 new hidden fields to the form and name them IREFERRER and LREFERRER. Do not change the naming of the fields.
act-on-form-referrer-source-tracking
  • Place the form on an Act-On landing page or on an external webpage. Remember the URL.

The javascript

The next step is the javascript. Upload the script to your website and copy the URL location of the javascript (you can download the script here). Do not upload it to your Act-On library because then it will be tracked as a download similar to a PDF.

  • To add the javascript to the website pages you use Google Tag Manager.
  • Create a new tag in Google Tag Manager and call it Source Tracking.
  • Select Custom HTML as the tag type and place the javascript code in the HTML box. Format is
<script src=”[URL location of javascript]” async></script>
google-tag-manager-referrer-source-tracking

The javascript must start loading after the Act-On form loading has completed, otherwise the data in the cookie cannot be placed in the Act-On form. For this you have to set the trigger:

  • Go to trigger configuration and select trigger type Timer.
  • Set interval to 1500 milliseconds.
  • Set limit to 1.
  • You can specify additional conditions when the script must be loaded. In this example, all page URLs must contain the text acton.
trigger-config-referrer-source-tracking
  • Save and publish the tag and you are ready to start testing.

Testing the script

  • Browse to the webpage with the Act-On form.
  • Submit the form
  • Check in Act-On the Form Submission List whether the fields for IREFERRER and LREFERRER are filled. The data should have the format of Http%3A// or the text direct.
stored-data-act-on-source-tracking
  • If the fields are empty check the debugging section in this blog.

Convert referrer to source

The stored data has the format of http%3A// and contains the full source URL. For convenience, you might want to change these to search, paid, referral, email or social. You can do this by connecting a maintenance program to the list:

  • Create a new field in the Form Submission List. Name this field Source.
  • Create a segment and name it Social.
  • The condition of the segment is: IREFERRER contains and enter all social media domain names.
  • Click Save.
  • Create a maintenance program to this segment, whereby the Source field is automatically filled in with the value Social.
  • You repeat the above steps for the other sources.
act-on-segment-referrer-source-tracking
The segment social
act-on-program-referrer-source-tracking
The maintenance program social

Advanced settings

Check terminusapp.com for some advanced settings for the javascript.

Debugging

If you don’t see any values ​​in the Form Submission List under IREFERRER and LREFERRER, this could mean the javascript is not loaded or the javascript does not fill in the hidden fields.

Check if the javascript is loaded using Google Chrome

  • Open your chrome browser. Install and activate the extension EditThis Cookie.
  • Go to the webpage with the Act-On form.
  • Click on the EditThisCookie icon and open the _uc_last_referrer tab. If there is a value the script loaded correctly.
act-on-editthiscookie-referrer-source-tracking
  • If there is no value, check if the URL of the javascript is correct.

Check if the Act-On form is being filled using Chrome

  • If the javascript loaded correctly the problem might be the Act-On form or settings in Google tag manager.
  • Go to the webpage with the Act-On form. Click the right mouse button and select Inspect.
act-on-inspect-referrer-source-tracking
  • Go to the TAB elements and search in the source code for the string IREFERRER. Check if the field contains a value as in the below example.
act-on-inspect-elements-referrer-source-tracking
  • If you see no value this could mean the naming of the fields is incorrect or the script is loaded before the Act-On form.

Download the javascript

Click to download the javascript (zipped).

Like this post?

If you like this post then also check the other Act-On hacks about website event tracking and video tracking in Act-On. If you have any question or remarks you can mail me. I will try to answer them as good as possible.