Skip to main content
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

ParameterTypeRequiredDescription
offer_idintegerYesThe offer identifier
affiliate_idintegerYesThe affiliate identifier
uidintegerNoOffer URL ID (extra destination URL)
creative_idintegerNoCreative identifier
sub1sub5stringNoSub-placement tracking values
source_idstringNoTraffic source identifier
coupon_codestringNoCoupon code for click-level attribution
fbclidstringNoFacebook click ID
gclidstringNoGoogle click ID
ttclidstringNoTikTok click ID
transaction_idstringNoCustom transaction ID (for ITP workaround)
tracking_domainstringNoTracking domain override (for multi-tenant setups — see Configuration)
parametersobjectNoFree-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'
  }
});
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
});
For fleet-wide organic fallback (applied automatically to every SDK call on the page), use EF.configure({ organic: {...} }) instead of per-call defaults.

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.