Custom Banner Text for California

This page demonstrates a standard Osano Cookie Consent configuration, except that users in California (CA) will see custom language on the consent banner. All other users see the default Osano banner text.

To implement this, add the following script immediately after your Osano.js script tag:

JavaScript
<script> window.Osano?.cm?.addEventListener('osano-cm-initialized', () => { if (window.Osano?.cm?.jurisdiction === 'us-ca') { const observer = new MutationObserver((mutations, obs) => { const message = document.querySelector('.osano-cm-content__message.osano-cm-message'); if (message && message.textContent.includes('This website utilizes technologies')) { message.textContent = 'This is an example of custom jurisdiction-based text for California users only. Feel free to replace this with your own legal or marketing language.'; obs.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); } }); </script>

Note: You can replace the custom message with your own legal or marketing language as needed.

How to customize for other states or text:
  • To target multiple states, change window.Osano?.cm?.jurisdiction === 'us-ca' to something like ['us-ca','us-tx','us-ny'].includes(window.Osano?.cm?.jurisdiction).
  • To target a different state, replace 'us-ca' with the desired jurisdiction code (e.g., 'us-tx' for Texas).
  • To change the custom banner text, edit the string inside message.textContent = '...' to your preferred message.
Example for multiple states:
if ([ 'us-ca', 'us-tx', 'us-ny' ].includes(window.Osano?.cm?.jurisdiction))