Use RightMessage with a cookie banner
You'll make RightMessage wait for your visitors' cookie consent, connect it to your banner, and check what still runs before they accept.
Updated
View as MarkdownKeep RightMessage in step with your cookie banner, so nothing is stored in a visitor's browser and no tests or stats run until they accept cookies. Your banner keeps control, and RightMessage keeps the page working in the meantime. It works on every plan.
Turning this on doesn't decide what your site legally needs. Check that with whoever manages your privacy requirements.
What waits for consent
With Wait for cookie consent on, until the visitor accepts:
- RightMessage stores nothing in the browser.
- It runs no tests. Visitors see Control in every A/B test and aren't counted.
- It sends no stats or analytics events. Those from the current page are held in page memory, then sent if the visitor accepts or discarded if they decline.
These still run, because the visitor chose to use them: form submissions, email platform lookups, webhooks and email steps. Personalization still shows on the page, without being remembered between pages.
When a visitor declines, RightMessage keeps behaving as it did before consent. When they accept, tests apply from their next page.
1. Turn it on
- If you use RightMessage Edge, update to
@rightmessage/cloudflareor@rightmessage/next0.2.0 or later and redeploy first. Older Workers stop personalizing the site until they're redeployed. - Open project settings and select General.
- Under Privacy, turn on Wait for cookie consent.
- Publish your changes.
2. Connect your banner
TCF v2.2 banners: RightMessage reads the banner's __tcfapi on its own. It counts consent for purposes 1, 5 and 6, and consent or legitimate interest for purpose 8.
Google Consent Mode: RightMessage reads your gtag('consent', 'default' | 'update', …) entries on its own. Consent counts when analytics_storage is granted and personalization_storage isn't denied. RightMessage only reads Consent Mode. It never changes it.
Any other banner: call the consent command from your banner's accept and decline handlers:
Call it on every page where the banner reports a decision, or once when the visitor decides if your banner remembers it. Call RM.push(['consent']) without a decision to read the state: 'pending', 'granted', 'denied', or 'not_required' when the project doesn't wait. A command outranks TCF and Consent Mode for the rest of the page. See the JavaScript command reference.
If your banner blocks scripts until consent instead, RightMessage doesn't run at all before the visitor accepts, so personalization and forms wait too. Letting RightMessage load and wait for consent itself keeps them working.
3. Check it
- Open your site in a private window and don't answer the banner.
- Open the debugger. Its Consent row says "Waiting for cookie consent. Nothing is stored, tests show Control and stats wait in page memory."
- Accept cookies. The row changes to "Cookie consent given", with what decided it, such as "by the TCF consent banner" or "by Google Consent Mode".
Opening the debugger also excludes that browser from tests and stats, so use a separate private window for anything you want counted.
Expect fewer visitors in your tests and stats after you turn this on, because visitors who don't accept aren't counted. Tests may take longer to reach a verdict.