Getting Started
Consent Prompts are created using the Osano Dashboard and can be deployed to your website using a simple JavaScript snippet. This snippet is provided to you when you create a new Consent Prompt, and can be found by clicking on the "Get Code" button on the Consent Prompt configuration page.
Adding a Consent Prompt to your Website
The snippet is constructed in the following way:
<script
data-customer-id="<your-customer-id>"
data-config-id="<your-config-id>"
src="https://clientapps.osano.com/uc-opt/index.js"
></script>
Replace <your-customer-id>
with your Osano Customer ID, and <your-config-id>
with the ID of the Consent Prompt you want to display. These values can be found on the "Developers" tab of the Consent Prompt configuration page.
This code snippet should be added to your website's HTML, typically in the <head>
.
Configuration Options
The Consent Prompt JavaScript snippet can be customized with additional configuration options. These options are provided through html data attributes on the script tag. The following options are available:
data-customer-id
(required): Your Osano Customer ID.data-config-id
(required): The ID of the Consent Prompt you want to display.data-show
(optional): Will display the Consent Prompt automatically when loaded.data-prevent-submit
(optional): Will prevent the Consent Prompt from submitting consent. Useful for testing and debugging in lower environments.