localStorage
).
How It Works
When you enable consent management, Radar operates in two stages on your customer’s website:- Before Consent: The tracker is fully functional but stores all data (like the device ID and user traits) in the end user’s
sessionStorage
. This data is cleared when the user closes their tab. - After Consent: Once the end user gives consent, a specific Radar function must be called. The tracker then migrates all data from
sessionStorage
tolocalStorage
and will use persistent storage from that point forward, allowing it to remember users across multiple sessions.
1. Enable Consent Management
To enable consent management, set thewaitForConsent
option to true
in your Radar loader script configuration.
HTML
localStorage
on your customer’s site until you explicitly tell it to via the giveCookieConsent
method.
2. Granting Consent
Your customer will need to implement logic to call thegiveCookieConsent()
method on the tracker’s namespace object when one of their users provides consent (for example, by clicking “Accept” on a cookie banner).
- It signals to Radar that it now has permission to use persistent storage for that end user.
- It migrates any existing anonymous ID and user traits from that user’s session storage to
localStorage
, so their identity is maintained.
The
giveCookieConsent
function only needs to be called once per user. Radar will remember that consent has been granted for all future sessions from that device.Example: Integrating with a Cookie Banner
Here is a simple example of how your customer could integrate Radar with a common cookie consent banner on their website. You can provide this snippet to them as a guide.HTML