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: '',

  disable_fingerprinting: false, // Optional. Browser fingerprinting is used to enhance user tracking. Defaults to false when omitted
});

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

});