Cookie consent: how Varly follows your cookie banner

Which cookie banners Varly works with, how to pick yours, and what happens before a visitor says yes.

In this article

Most shops already have a cookie banner (also called a consent management platform, or CMP). Varly connects to that banner, so visitors make one choice in one place. When you add a site, Varly looks at your homepage and sets the banner it recognizes. You can always change it.

Pick your banner

  1. Go to Settings → Tracking & privacy.
  2. Under Consent banner, choose one of these:
    • Detect automatically: Varly looks for any of the banners below on each page. A good choice if you are not sure.
    • CookieScript: Varly measures when the visitor accepts the Performance category.
    • Cookiebot: Varly measures when the visitor accepts the Statistics category.
    • OneTrust: Varly measures when the visitor accepts the Performance cookies group.
    • Shopify’s own cookie banner: the banner you switch on in Shopify under Settings → Customer privacy. Varly measures when the visitor allows analytics. In countries where Shopify doesn't show the banner, Shopify allows it by default.
    • Google Consent Mode: for any banner that sends Google Consent Mode signals, such as Usercentrics, CookieYes and Complianz. Varly measures when analytics_storage is granted. This works whether the banner uses the Google tag (gtag), Google Tag Manager or a Tag Manager template, and also when the choice is set a little later, after the page has loaded.
    • Other (custom code): your developer passes each visitor’s choice to Varly. For other banners, or your own solution. See For developers below.
  3. Click Save. The snippet picks up the change within a minute.

What happens before a visitor accepts

Until the visitor accepts, Varly does nothing on that visit:

  • no cookie is set and no data about the visit is sent to Varly;
  • no heatmap clicks, no recordings;
  • no surveys are shown;
  • the visitor sees the original version of your pages, not a test variant.

When the visitor accepts, Varly starts right away on that page, without a reload. When a visitor declines, Varly stays off. If they later withdraw their consent in your banner, Varly stops measuring at once.

This means your Varly numbers only include visitors who accepted. That is normal, and the same for every visitor group, so A/B test results stay fair.

Varly always waits for a consent signal. If your site has no cookie banner, Varly measures nothing. Choose Other (custom code) and ask your developer to tell Varly when measuring is allowed, as described below. Whether you need a banner is a decision for you and your privacy advisor.

Most banners ask you to declare the cookies on your site. Varly uses:

  • _varly_id: a first-party cookie with a random visitor ID, kept for one year. Varly keeps the same ID in the browser's local storage, so it survives if a banner removes unknown cookies. Purpose: recognizing returning visitors for statistics and A/B tests. Category: statistics / analytics.
  • Browser storage (not cookies) for the current session and for surveys a visitor has already seen or closed. Names start with varly_ or __varly_.

Varly sets these only after the visitor accepts. The only exceptions are the notes for excluding your own browser and for previewing tests, which only you and your team use. Read more in Privacy and GDPR.

Common problems

My banner removes cookies it doesn't know. Some banners, such as CookieScript and Cookiebot with automatic blocking, delete cookies that aren't on their list. Add _varly_id to your banner's cookie list in the statistics or analytics category. Varly also keeps the visitor ID in local storage, so returning visitors are still recognized in the meantime.

I accepted cookies but nothing comes in. Check that the right banner is chosen. If your banner isn't listed, choose Detect automatically or Other (custom code). See Check that Varly is working.

My banner loads through Google Tag Manager. Varly can't always see it when you add your site, so the setting may not be filled in for you. Choose your banner by hand, or use Detect automatically. Once chosen, Varly also picks up a consent choice that is set later on the page.

Numbers are lower than in other tools. Varly only counts visitors who accepted. Tools that count everyone, or use their own rules, show higher numbers.

For developers

With Other (custom code), call this after the visitor agrees to analytics:

window.Varly && window.Varly.consent(true)

Call window.Varly.consent(false) when the visitor withdraws consent; Varly then stops measuring on the page. If you know the choice before the snippet loads, you can also set window.__varlyConsent = true (or false) first. Detect automatically also listens for these calls.

Was this article helpful?

Still stuck? Email support@varly.ai and we'll help you out.

Related articles

Updated 5 November 2026