Configure LimeLight Tracking

 

For maximum page performance, all the LimeLight traffic attribution script code should be added to the BOTTOM of your traffic pages, before the closing </body> tag. If you view this page's source, you'll see the working examples of what is described here.

LimeLight Tracking Script

Copy and Paste the script below on ALL your offer pages


<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');


ga( 'create', 'UA-80325941-3', 'auto', 'limelightTracker' );// This is “UA-80325941-3” (not your own) - you are free to still have your own analytics tracking along with this.
ga( 'limelightTracker.set', 'dimension1', 'appkey' );// Your LimeLight subdomain here (appkey.limelightcrm.com)
ga( 'limelightTracker.set', 'dimension2', 'Campaign_ID' );// your LimeLight campaign ID here, this will be unique per LL campaign
ga( 'limelightTracker.send', 'pageview' );
</script>

<script src="//cdn.limelightcrm.com/traffic-attribution/limelight-traffic-attribution.min.js"></script>
<script>
UtmCookie = new UtmCookie();
document.cookie('utm_medium' = UtmCookie.utm_medium());
document.cookie('utm_source' = UtmCookie.utm_source());
document.cookie('utm_campaign' = UtmCookie.utm_campaign());
document.cookie('utm_term' = UtmCookie.utm_term());
document.cookie('utm_content' = UtmCookie.utm_content());
document.cookie('device_category' = UtmCookie.device_category());
</script>

Submit UTM Parameters in Transaction API Request

Below example is just an illustration of how to pull out the utm_ and device_category data out of the UtmCookie object in order to pass it into the Lime Light API call. You would likely have to embed these into your checkout form as hidden fields.

Copy and paste into your php file used to make the API request.

$utm_values = [
	‘utm_medium’,
	‘utm_source’,
	‘utm_campaign’,
	‘utm_term’,
	‘utm_content’,
	‘device_category’,
];

foreach ($utm_values as $utm)
{
	if ($_COOKIE[$utm])
	{
	$request[$utm] = $_COOKIE[$utm];
	}
}


LimeLight Traffic Attribution requires a small amount of work on front end traffic pages. A combination of using Google Analytics and passing in related fields into your NewOrder/NewOrderWithProspect/NewOrderCardOnFile API calls allows us to collect the data we need to provide analytics based reporting for your entire traffic funnel and match it with all the existing metrics found in our Analytics product. We will be able to fully segment your traffic by utm_source/utm_medium/deviceCategory using this method (and also further analyze by utm_campaign, utm_term, and utm_content if you so desire.

We have created a simple pure javascript library limelight-traffic-attribution.js (and minified limelight-traffic-attribution.min.js) which is available on our CDN. You should use the CDN version in your page source reference in case we make updates to the device detection libraries in the future. Our CDN network is distributed worldwide for high speed and low latency access to core Lime Light assets. 

This is important for the 2nd part of the integration. Instantiating this on every page will automatically look for any google utm_ parameters on the URL and save them to a cookie for later use. You will need to pass this utm_ and device_category information into the Lime Light API calls for executing transactions.  How you do this will be specific to your implementation of the Lime Light integration. Since the utm_source, utm_campaign, utm_medium, utm_term, utm_content, and device_category parameters need to be sent into the NewOrder, NewOrderCardOnFile, and/or NewOrderWithProspect API calls, you may need to post these 6 fields as hidden fields to your server side that is making the API calls (via the checkout page/form).

For LimeLight Traffic Attribution to provide analytics and traffic segmentation across source, campaign, and device category (mobile, tablet, desktop), this second step MUST be taken to pass traffic attribution core fields into your NewOrder/NewOrderCardOnFile/NewOrderWithProspect API calls. There are 6 additional parameters that we have made available in those API calls (utm_source, utm_campaign, utm_medium, utm_term, utm_content, device_category), and the UtmCookie javascript object from Lime Light helps with extracting the data from the client browser upon hitting your traffic landing page. The limelight-traffic-attribution.min.js file served from our CDN (content distribution network) is lightweight at 6kb and designed with fast performance in mind. In most cases, these client side parameters must be sent to your server-side pages that processes the actual Lime Light API (NewOrder) call. You will likely need to push these parameters into your final checkout form so that your server-side code can access them.

New API parameters

Field Name Definition
utm_source Used to identify the traffic source, such as affiliate, Google, Facebook etc.
utm_medium Used to identify a medium like sub-affiliate, email, cost per click, etc.
utm_campaign Used to identify your campaign, such as your website, a specific sale, etc.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.