October 12, 2017 19:45

For maximum page performance, all the sticky.io 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.

Tracking Script

Copy and Paste the script below on ALL your offer pages (CDN resource found here


(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' );   UtmCookie = new UtmCookie(); document.cookie = 'utm_medium=' + UtmCookie.utm_medium() + ';path=/';document.cookie = 'utm_source=' + UtmCookie.utm_source() + ';path=/';document.cookie = 'utm_campaign=' + UtmCookie.utm_campaign() + ';path=/';document.cookie = 'utm_term=' + UtmCookie.utm_term() + ';path=/';document.cookie = 'utm_content=' + UtmCookie.utm_content() + ';path=/';document.cookie = 'device_category=' + UtmCookie.device_category() + ';path=/';

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 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 = [








foreach($utm_values as $utm)


    if ($_COOKIE[$utm])


        $request[$utm] = $_COOKIE[$utm];




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 sticky.io 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 API calls for executing transactions. How you do this will be specific to your implementation of the sticky.io 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 sticky.io 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 sticky.io 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 sticky.io 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.

Did this answer your question?