Ask visitors for consent before tracking
Some sites need each visitor to accept analytics cookies before any tracking starts. Consent mode makes the RadarSend tracking snippet wait for that decision. Until the visitor accepts, it sends nothing and sets no cookies, and if they decline, it stays quiet for the rest of the page.
It’s off by default. Turn it on if your cookie banner has to control analytics.
Before you begin#
- The tracking snippet on your site. See Add tracking to your website.
- A cookie banner, or your own code that knows when a visitor accepts or declines analytics.
What happens before a visitor decides#
While a visitor hasn’t decided yet, the snippet:
- sends nothing to RadarSend, and doesn’t read or set cookies, and
- holds up to 50 page views, events and
identify()calls in memory.
When they accept, the held calls are sent in order. When they decline, the held calls are thrown away and RadarSend’s cookies are removed. If they change their mind later, the snippet follows the new decision.
Step 1 — Switch to the consent-aware snippet#
- Go to Settings→Website tracking.
- Under Visitor consent, turn on Use a consent-aware snippet.
- Under Consent tool, pick how the snippet learns the visitor’s choice:
- Cookiebot reads Cookiebot’s statistics consent.
- OneTrust reads OneTrust’s active groups. Enter the group for analytics under Category ID. It’s
C0002(Performance) by default. - WordPress Consent API reads the
statisticscategory from the WP Consent API plugin. - Manual (JavaScript call) waits for your code to tell it. See Tell the snippet yourself.
- Copy the snippet under Your snippet and replace your current one on every page. It now has two parts: a short
window._qpline and the script tag with adata-consentattribute.
<script>window._qp=window._qp||{_q:[]};</script>
<script src="https://t.example.com/_q/qs.js" data-tenant-key="your-key" data-consent="cookiebot" async></script>
Step 2 — Test a consented visit#
Open your site in a private window, accept analytics in your banner, and view a page. Then decline in another private window and check that your banner’s choice holds.
Back in RadarSend, click Check for test visit. When the visit arrives, Consented test visit shows Received.
If Requests from older snippets appears below it, some pages still load the previous snippet. Replace it everywhere, including landing pages built in another tool and any tag manager container you haven’t published.
Step 3 — Require consent#
Tick The consent-aware snippet is on every page, and I’ve tested accepting and declining., then click Require consent. The Visitor consent label now shows Required.
From now on, RadarSend ignores tracking from any page that didn’t get the visitor’s consent, including pages still running the old snippet.
The change reaches all tracking within about a minute.
Tell the snippet yourself#
With Manual (JavaScript call), call _qp.consent() on every page load once you know the visitor’s choice, and again whenever they change it:
_qp.consent({ analytics: true }); // accepted
_qp.consent({ analytics: false }); // declined
If your banner can decide before the snippet has loaded, queue the decision instead. The snippet applies the latest one when it loads:
window._qp = window._qp || { _q: [] };
window._qp._q.push(['consent', [{ analytics: true }]]);
Once the snippet has loaded, window._qp._q no longer exists, so call _qp.consent() directly. The queue script in Identify visitors and track events handles both cases for you.
Common issues#
- Check for test visit finds nothing. Make sure the page has the new two-part snippet and that you accepted analytics, not only necessary cookies. With OneTrust, check that Category ID matches the group your banner uses for analytics.
- Nothing is tracked after you turned on Require consent. Visitors who haven’t accepted aren’t tracked, so expect fewer visits than before. If no visits arrive at all, check the snippet’s
data-consentvalue matches your consent tool.
Good to know#
- To stop requiring consent, click Turn off consent mode. Put the regular snippet back afterwards, because the consent-aware one still waits for a decision.
- Once consent is required, links in your emails to your own website carry the click in the page address (a
_sseidparameter) instead of a cookie. The snippet removes it from the address bar, and if the visitor accepts, their visits are connected to their contact as usual. - Consent mode only affects website tracking. Email open and click reporting isn’t affected.
- If the snippet can’t find your consent tool on the page, it waits, and nothing is sent.