The EF.impression() method records an impression event. Use this for CPM-based offers or when you need to track ad views.
Basic Usage
EF.impression({
offer_id: 1,
affiliate_id: 1
});
Parameters
| Parameter | Type | Required | Description |
|---|
offer_id | integer | Yes | The offer identifier — can be omitted when coupon_code is supplied |
affiliate_id | integer | Yes | The affiliate identifier |
coupon_code | string | No | A coupon code — records a coupon-attributed impression (can be sent instead of offer_id) |
creative_id | integer | No | Creative identifier |
sub1 – sub10 | string | No | Affiliate sub-placement tracking values |
adv1 – adv10 | string | No | Advertiser sub-parameter values |
source_id | string | No | Traffic source identifier |
fbclid | string | No | Facebook click ID |
gclid | string | No | Google click ID |
tracking_domain | string | No | Tracking domain override (for multi-tenant setups — see Configuration) |
parameters | object | No | Free-form custom key–value parameters |
Examples
Basic impression:
EF.impression({
offer_id: 1,
affiliate_id: 1
});
With URL parameters:
EF.impression({
offer_id: EF.urlParameter('oid'),
affiliate_id: EF.urlParameter('affid')
});
EF.urlParameter() returns an empty string when the parameter is not present in the URL. In that case, nothing is passed for that field — the SDK simply omits it from the impression.
Multi-tenant with specific tracking domain:
When multiple Everflow accounts fire impressions on the same page, pass tracking_domain on each call to route it to the correct account — regardless of which account’s SDK script was originally loaded on the page. See Multi-account tracking for the full pattern and caveats.
EF.impression({
tracking_domain: 'www.tracking-domain-b.com',
offer_id: 50,
affiliate_id: 17
});
With custom parameters:
EF.impression({
offer_id: 1,
affiliate_id: 1,
parameters: {
placement: 'sidebar',
page_type: 'article'
}
});
Coupon-level impression:
When attribution is driven by a coupon code, pass coupon_code in place of offer_id. A common pattern is to read it from the inbound utm_source:
EF.impression({
coupon_code: EF.urlParameter('utm_source'),
source_id: window.location.hostname
});