The EF.click() method records a click event and returns a Promise that resolves with the transaction ID. This transaction ID can then be used for conversion attribution.
Basic Usage
EF.click({
offer_id: 1,
affiliate_id: 1
});
Parameters
| Parameter | Type | Required | Description |
|---|
offer_id | integer | Yes | The offer identifier |
affiliate_id | integer | Yes | The affiliate identifier |
uid | integer | No | Offer URL ID (extra destination URL) |
creative_id | integer | No | Creative identifier |
sub1 – sub5 | string | No | Sub-placement tracking values |
source_id | string | No | Traffic source identifier |
coupon_code | string | No | Coupon code for click-level attribution |
fbclid | string | No | Facebook click ID |
gclid | string | No | Google click ID |
ttclid | string | No | TikTok click ID |
transaction_id | string | No | Custom transaction ID (for ITP workaround) |
tracking_domain | string | No | Tracking domain override (for multi-tenant setups — see Configuration) |
parameters | object | No | Free-form custom key–value parameters |
Return Value
EF.click() returns a Promise that resolves with the transaction ID:
EF.click({
offer_id: 1,
affiliate_id: 1
}).then(function(transactionId) {
console.log('Transaction ID:', transactionId);
});
Examples
With sub-placements and URL parameters:
EF.click({
offer_id: EF.urlParameter('oid'),
affiliate_id: EF.urlParameter('affid'),
sub1: EF.urlParameter('sub1'),
sub2: EF.urlParameter('sub2'),
source_id: EF.urlParameter('source')
});
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 click.
With custom parameters:
EF.click({
offer_id: 1,
affiliate_id: 1,
parameters: {
campaign_name: 'summer_sale',
landing_page: 'variant_b'
}
});
ITP Workaround and First-Party Cookie Tracking
You can combine the SDK with traditional redirect tracking links to enhance attribution on browsers that restrict third-party cookies (Safari ITP, etc.). When a user lands on your owned landing page after going through a redirect link, fire EF.click() with the transaction_id extracted from the URL — the SDK will set a first-party cookie on your landing-page domain, making subsequent conversion attribution more reliable.
Configure your tracking link’s destination URL to include the transaction_id, offer_id, and affiliate_id macros. For a destination URL like:
https://destination-url.com?transaction_id=af189e77650e4e908af797b61b03ac0b&oid=1&affid=5
fire the SDK click with the extracted values:
EF.click({
offer_id: EF.urlParameter('oid'),
affiliate_id: EF.urlParameter('affid'),
transaction_id: EF.urlParameter('transaction_id')
});
The SDK recognizes the existing transaction_id and enhances attribution without creating a duplicate click.
Advanced Usage
Preventing duplicate clicks
Use EF.getTransactionId() to check whether a transaction already exists for the offer before firing a new click — useful when the same page may be loaded multiple times for a returning user:
var offerId = 3;
var previousTransactionId = EF.getTransactionId(offerId);
if (!previousTransactionId) {
EF.click({
offer_id: offerId,
affiliate_id: EF.urlParameter('affid')
});
} else {
// The user already has a transaction for this offer — skip firing a new click
}
Falling back to default values
When the URL may not always contain offer_id or affiliate_id parameters, you can supply default values rather than letting the click fail:
var DEFAULT_OFFER_ID = 1;
var DEFAULT_AFFILIATE_ID = 10;
var offerId = EF.urlParameter('oid') || DEFAULT_OFFER_ID;
var affiliateId = EF.urlParameter('affid') || DEFAULT_AFFILIATE_ID;
EF.click({
offer_id: offerId,
affiliate_id: affiliateId
});
Multi-tenant attribution (multiple Everflow accounts)
When multiple Everflow accounts fire clicks on the same page, pass tracking_domain per call to route each click to the correct account. See Multi-account tracking for the full pattern and caveats.