Skip to main content

How to use links and attributes to show modals

Use links to trigger banner Consent Studio elements to show

Updated today

Triggering the Consent Studio consent banner with links and custom attributes

You can allow users to open your Consent Studio banner at any time by adding simple links to your website. This is useful for creating "Cookie Settings" or "Privacy Preferences" links in your footer, menu, or anywhere else on your site.

This is especially useful when disabling the default Consent Studio toggle. This way, you can still offer your website visitors a way to change their consent preferences β€” from your website's footer, for example.

Opening the Consent Banner

To create a link that opens your consent banner, use one of these methods:

Method 1: Using a Hash Link

<a href="#consent-banner">Cookie Settings</a>

Method 2: Using a Data Attribute

<a href="#" data-action="show-consent-banner">Cookie Settings</a>

Both methods work identically - use whichever fits better with your existing code structure.

Opening the overview of tracking technologies

If you want to show users the detailed list of cookies your site uses, you can create a link that opens the cookie list directly:

Method 1: Using a Hash Link

<a href="#cookie-list">View Cookie List</a>

Method 2: Using a Data Attribute

<a href="#" data-action="show-cookie-list">View Cookie List</a>

Common Use Cases

Footer Link

Add a cookie settings link to your footer so users can always access their preferences:

<footer>   
<p>
<a href="/privacy-policy">Privacy Policy</a> | <a href="#consent-banner">Cookie Settings</a>
</p>
</footer>

Privacy Policy Page

Let users adjust their settings directly from your privacy policy:

<p>You can manage your cookie preferences at any time by clicking <a href="#consent-banner">here</a>. </p>

Button Instead of Link

These selectors also work with buttons if you prefer:

<button data-action="show-consent-banner">Manage Cookies</button>

Important Notes

  • These links work automatically once Consent Studio is installed on your domain. No additional setup required

  • Users can update their consent preferences whenever they click these links.

  • The links work on any page of your website.

  • Hash links (#consent-banner, #cookie-list) won't cause page scrolling or navigation.


​

Did this answer your question?