How consent mode works
Consent state is stored inlocalStorage under the key agentref_consent with values 'granted' or 'denied'. On each page load, the script checks this value before doing anything:
- No consent stored + consent required – the script initializes (sets
ready) but skips cookie writing and click recording. Aconsent_pendingwarning is added to the debug info. 'granted'– tracking proceeds normally.'denied'– any existing AgentRef cookies are cleared and tracking is disabled.- Consent not required – tracking always proceeds regardless of stored consent (the default for programs that have not enabled consent mode).
trackingRequiresConsent is baked into the served script config for your program.
Integrating with a cookie consent manager
- OneTrust
Deferring tracking with data-consent
If you want to prevent the script from running at all until consent is determined (for example, to avoid the script executing before your banner has loaded), you can enable consent mode in program settings rather than using a script attribute. The trackingRequiresConsent flag is embedded in the script config served from the endpoint.
There is no data-consent HTML attribute – consent gating is controlled entirely through your program settings and the AgentRef.setConsent() API.
What happens without consent
When consent is required and not yet granted:- No cookies are written (
agentref_cid,agentref_pid,agentref_src,agentref_vid,agentref_ts) - Clicks are not recorded to AgentRef’s backend
AgentRef.getCheckoutMetadata()returns{}AgentRef.ready()callbacks still fire (with empty state), so your checkout code won’t hang
- All existing AgentRef cookies are cleared from the visitor’s browser
- Tracking remains disabled until consent is granted in a future session
GDPR compliance summary
What data does AgentRef store?
What data does AgentRef store?
When a click is recorded, AgentRef stores:
- The referral code (affiliate identifier)
- The page URL the visitor landed on
- The visitor’s IP address (for unique click deduplication – not linked to personal identity)
- User agent string
- Country (derived from IP, not stored as IP)
- UTM parameters and ad-click IDs present in the URL
- Sub-IDs passed by the affiliate
- An anonymous visitor ID generated by the script
How long is data retained?
How long is data retained?
Click records are retained according to your program’s cookie duration setting (default 30 days) for active attribution. Conversion records are retained indefinitely as they are financial records tied to affiliate payouts.The anonymous visitor ID cookie (
agentref_vid) has a 365-day lifetime. This is a random string with no external linkage – it is used only to deduplicate click counts within AgentRef.Can visitors request deletion?
Can visitors request deletion?
Visitors can delete AgentRef cookies at any time through their browser settings. Since the anonymous visitor ID has no linkage to personal identity, there is no personal data to delete from AgentRef’s backend based on a cookie value alone.If a visitor makes a data deletion request that you need to fulfill, contact AgentRef support with the relevant click tokens or conversion IDs.
Is the data shared with third parties?
Is the data shared with third parties?
This page describes how AgentRef’s technical implementation supports GDPR compliance. It is not legal advice. Consult your legal team to determine the correct consent category and wording for your cookie banner.