Embedding your preference center is a quick process with just three steps. Before getting started, ensure you’ve set up your preference hub. If not, follow the steps for creating a configuration before proceeding.
Steps to complete
- Confirm all valid domains are added and publish the configuration
- Retrieve the iframe code snippet to insert in the body of the website page
- Paste the Consent Security Policy (CSP) and Javascript SDK code into the head of your website
Step 1: Configure Your Domains & Publish
Add Valid Domains:
In your configuration settings, make sure that all relevant domains and subdomains where the Preference Center will be displayed are added.
Save and Publish:
Once all domains are configured, click "Save" and then hit the "Publish" button in the top corner of the page.
Step 2: Retrieve the Code Snippets
Get the Code Snippets:
Click the "Get Code" button in the top right of the configuration page. This will provide you with the necessary code snippets for embedding the preference center.
Copy to Clipboard:
Use the "Copy to clipboard" buttons to easily copy the iframe and JavaScript SDK code.
Step 3: Embed the Code in Your Website
Embed the iFrame:
Paste the iframe code snippet into the body of the page where you want users to manage their consents and preferences. You can adjust the size and height of the iframe by adding additional attributes at this point.
Insert Content Security Policy & JavaScript SDK:
Copy the provided Content Security Policy (CSP) code and JavaScript SDK link from the "Get Code" popup. Insert them into the <head>
section of your website.
Final Step: Publish to Your Website
Once the code is embedded and the necessary settings are in place, publish your website. Your preference center is now live, and users can begin updating their consents.