Skip to main content
Version: 2.6.0

Set referrer

Call setReferrer to manually trigger an sdk_click when you need to pass click or attribution data outside the normal tracker redirect flow.

Method signature​

Adtrace.setReferrer(referrer);
ParameterTypeDescription
referrerstringURL-encoded referrer string for the click.

Example​

Adtrace.setReferrer('adtrace_external_click_id%3DEXTERNAL_CLICK_ID');
Important

Call setReferrer as close as possible to Adtrace.initSdk for correct attribution.

The referrer value must be URL-encoded.

Typical init flow​

Adtrace.initSdk({
appToken: '{YourAppToken}',
environment: 'sandbox',
logLevel: 'verbose',
});

Adtrace.setReferrer('adtrace_external_click_id%3DEXTERNAL_CLICK_ID');