Free

WP Consent API analytics: Complianz, Cookiebot and more

Vireo works with consent plugins that use the WP Consent API, such as Complianz, Cookiebot and Real Cookie Banner. It stores nothing on the visitor's device, so by default it counts without waiting for consent.

Plan
Free
Default
Counts without waiting, since nothing is stored on the device
Consent category
Statistics

How it behaves

  • Vireo registers with the WP Consent API as a plugin that follows it.
  • With consent required, the tracker waits for statistics consent. The check runs in the visitor's browser, so it works with page caching.
  • Time on page waits for consent the same way: a report made before the visitor agrees is held in the page and sent once they do.
  • Visitors whose browser sends Do Not Track or Global Privacy Control aren't counted, with or without a consent plugin.

What it does with a consent plugin

  • Vireo registers with the WP Consent API as a plugin that follows it. Consent plugins read that as a declaration that it respects consent.
  • With the filter on, the tracker asks the browser for statistics consent through wp_has_consent and listens for wp_listen_for_consent_change. A pageview that happens while the banner is open is held, up to twenty events, and sent when the visitor agrees.
  • The check runs in the browser, so a cached page serves every visitor the same markup and each visitor's own answer applies.
  • Do Not Track and Global Privacy Control are read from the browser and from the request headers.

Set it up

  1. Install Vireo Analytics and a consent plugin that supports the WP Consent API.
  2. If you want Vireo to wait for statistics consent, add the filter below to your theme's functions.php or a small plugin. There's no setting for it.
add_filter( 'vireo_require_consent', '__return_true' );

What you'll see

  • Overview totals count a visitor from the moment statistics consent is granted. The pageview held while the banner was open is sent at that point.
  • With the filter off, the Overview counts every visit as it happens, since nothing is stored on the visitor's device.

Free or Pro

Free. Part of the free plugin.

Worth knowing

  • The filter works with any consent plugin that uses the WP Consent API.
  • Visitors are counted once they give statistics consent.

Questions

Which consent plugins work?

Any plugin that uses the WP Consent API, including Complianz, Cookiebot and Real Cookie Banner.

Where do I turn on waiting for consent?

It's a filter. Add vireo_require_consent from the code box above to your theme's functions.php or a small plugin.

What if no consent plugin is active?

Vireo counts as usual. The consent check only runs when a WP Consent API plugin is active.

Can the opt-out signal handling be changed?

Do Not Track and Global Privacy Control are honored by default. A developer can return false from the vireo_honor_opt_out filter to change that.

Docs

Related integrations

All integrations

Try Vireo on your own site

Vireo Analytics is a free WordPress plugin. It counts visits without cookies and keeps everything in your own database.

Get Vireo free on WordPress.org