Cookie consent for your custom code

Hold your header, body and footer snippets until a visitor accepts their category in a cookie banner, and see what visitors get.

Last updated October 9, 2026

Analytics tags, ad pixels and chat widgets set cookies. In many places a visitor has to agree before they do. Wait for cookie consent makes that automatic for the snippets you add under Settings, Custom code: each one stays inert until the visitor accepts the category it belongs to.

What you need: the Whitelabel plan with your own domain verified, and an owner or staff account. On the Agency plan the Custom code section shows an upgrade card instead. The snippets run on your own domain only.

Turn it on

  1. Open Settings, then Custom code.
  2. Turn on Wait for cookie consent.
  3. For each slot (Header, Body and Footer), pick its category: Analytics or Marketing. A new slot starts as Marketing, which is the safer choice when you are not sure.
Suggested image Crop of Settings, Custom code: the Wait for cookie consent switch turned on, the Header slot showing its category set to Marketing, and the Runs before consent option unticked beneath the code box.

The settings save themselves. A slot still has to be switched on, and a snippet only reaches visitors once it is.

Pick the right category

  • Analytics is for tools that measure how your app is used.
  • Marketing is for ad pixels, remarketing and anything that tracks people across sites.

A slot holds one category, so keep your analytics tag and your ad pixel in different slots. A visitor who accepts only Analytics runs the analytics slot and not the marketing one.

If you already run a consent tool of your own, put it in a slot and tick Runs before consent on that slot. That slot always runs, whatever the visitor has chosen, so the tool can load and ask. Use this for the consent tool only: anything else in that slot runs without agreement.

What visitors see

The banner appears on its own, and only on pages where a snippet is waiting. A page with nothing waiting shows no banner. It has three buttons:

  • Reject all runs nothing that is waiting.
  • Customize lets the visitor choose Analytics and Marketing separately.
  • Accept all releases everything that is waiting.
Suggested image Screenshot of the cookie banner on a white-labeled client domain, showing the Cookies title, the short explanation with no platform name, and the three buttons Reject all, Customize and Accept all in one row.

On your domain the banner never names the platform. The choice is stored in a cookie called ra_consent for 180 days, then the banner asks again. A visitor changes their mind through the small cookie button at the bottom left of the page. If they take back a category, the page reloads, because a script that already ran cannot be unloaded.

Google tags get the same answer through Google Consent Mode v2. Until the visitor accepts, storage for analytics, ads and personalization is denied, and it switches to granted only for the categories they accept.

What we record

Each answer is logged with a random id, your site, the choice, the banner version and the time. There is no IP address and no name. These records are kept for 3 years, so you can show that a visitor agreed.

If you leave the switch off

Every snippet then runs on every page load and no banner appears. You are responsible for getting consent before those tags run, either with your own tool or because the tags set no cookies.

Advanced: release snippets from your own tool

A consent tool in a Runs before consent slot can release the waiting snippets by firing a ra:consent event on window:

window.dispatchEvent(
  new CustomEvent("ra:consent", {
    detail: { analytics: true, marketing: false },
  })
);

analytics and marketing are true or false. A snippet runs when its category is true. Fire the event again whenever the visitor changes their choice.

Was this helpful?

Still stuck? Send us the profile and the comment you are looking at and we will answer with the fix rather than a link back here.

Contact ReviewComet support