Impression Tracking

Tracking impressions using the Everflow SDK

The simplest way to start tracking impressions is to generate an impression using the following code :

EF.impression({
  offer_id: 1, // Required. The offer id
  affiliate_id: 1, //Required. The affiliate id
});

You may wish to add additional data that will be passed along with the impression :

EF.impression({
  offer_id: 1, // Required. The offer id
  affiliate_id: 1, //Required. The affiliate id

  // Optional. Sub placement values.
  sub1: '',
  sub2: '',
  sub3: '',
  sub4: '',
  sub5: '',
  source_id: '',

  fbclid: '...', // Facebook unique click ID
  gclid: '...', // Google unique click ID
});

Extracting data from the URL

When working with direct linking, the affiliate id involved in the impression will most likely be dynamic and the value will be passed in the query string of the URL.

The Everflow SDK provides a method to extract any value from the URL. In the following example, the script executes on a landing page where the affiliate id is passed using the affid url parameter : https://destination-url.com?affid=5

EF.impression({
  offer_id: 1, // Required. The offer id
  affiliate_id: EF.urlParameter('affid'), //Required. The affiliate id
});

The EF.urlParameter can be used to extract any query string parameter from the URL. For example if the destination URL was instead : https://destination-url.com?oid=3&affid=5&src=facebook&app=mobile, you could use the following code :

EF.impression({
  offer_id: EF.urlParameter('oid'), // Required. The offer id
  affiliate_id: EF.urlParameter('affid'), //Required. The affiliate id
  
  sub3: EF.urlParameter('src'), // Optional : "facebook" would be passed as the sub3 in this example
  sub4: EF.urlParameter('app'), // Optional : "mobile" would be passed as the sub4 in this example
  sub5: EF.urlParameter('ref'), // The "ref" query string parameter is missing from the URL. Nothing would be passed as the sub5

});

Custom Parameters

It’s also possible to add free form parameters to the impression. This is effectively equivalent to adding additional query string parameters to the tracking link URL.

EF.impression({
  offer_id: EF.urlParameter('oid'), // Required. The offer id
  affiliate_id: EF.urlParameter('affid'), //Required. The affiliate id

  //Optional. Free form parameters to be appended to the impression URL
  parameters: {
    "param1" : "customValue1",
    "param2" : "customValue2" 
  }
})

Multiple Everflow Accounts

In a typical scenario where a single Everflow account generates an impression on a page, there is no need to “identify” the account responsible for the impression. The information is inferred from the <script> tag used to include the Everflow SDK. For example :

<script type="text/javascript" 
        src="https://www.TRACKING-DOMAIN-A.com/scripts/sdk/everflow.js"></script>
<script>
  // This click will be attributed to the account that owns "www.TRACKING-DOMAIN-A.com"
  EF.impression({
    offer_id: 1,
    affiliate_id: 1
  });
</script>

Situations may come up where multiple Everflow customers wish to generate impressions on the same page (multi-tenant scenarios). The EF.impression function takes an optional tracking_domain parameter that can be used to associate impressions with specific accounts, regardless of the account that originally imported the script on the page.

<script type="text/javascript" 
        src="https://www.TRACKING-DOMAIN-A.com/scripts/sdk/everflow.js"></script>
<script>
  // This impression will be attributed to the account that owns "www.TRACKING-DOMAIN-A.com"
  EF.impression({
    tracking_domain: "www.TRACKING-DOMAIN-A.com",
    offer_id: 1,
    affiliate_id: 1
  });

  // This impression will be attributed to the account that owns "www.TRACKING-DOMAIN-B.com"
  EF.impression({
    tracking_domain: "www.TRACKING-DOMAIN-B.com",
    offer_id: 50,
    affiliate_id: 17
  });
</script>

More information about multi-tenant scenarios can be found on the Click Tracking page.