Embed the cookie banner

The public customer and WordPress loader is this URL only:

https://cookieoptions.com/assets/loader.js

Use a query string when hosted assets change. The pinned example below uses v=1.0.1.

Exact snippet

Place this just before </body>. Replace example.com with the domain you registered.

<script src="https://cookieoptions.com/assets/loader.js?v=1.0.1" data-site="example.com" async></script>

That tag is:

<script src="https://cookieoptions.com/assets/loader.js?v=1.0.1" data-site="example.com" async></script>

Omit data-site

If you leave out data-site, the loader uses the current hostname (without www.).

<script src="https://cookieoptions.com/assets/loader.js?v=1.0.1" async></script>

Footer link

After the loader has run, visitors can reopen the banner with window.ogConsentManager.openPreferences(). window.coConsentManager is the same object.

<a href="#" onclick="window.ogConsentManager.openPreferences(); return false;">Cookie Settings</a>

What the loader requests

Paths are resolved from the loader script origin, or from data-base if you set it.

  • Banner CSS: /assets/og-consent-manager.css
  • Banner JS: /assets/og-consent-manager.js
  • Site settings: /backend/site-config.php?site=
  • Consent log: POST /backend/log-consent.php

If the domain is not in the database yet, banner init does nothing. Register the domain first, then the same tag starts working.

Google Consent Mode v2

Choices map to analytics_storage, ad_storage, ad_user_data and ad_personalization. Existing GTM containers can keep listening for stcm_consent_update.

How it works · Create an account