Pass Cookie Consent To Script Manager

This documentation provides JavaScript that enables you to pass cookie consent from your contact to Script Manager.

When you accept consent or no consent to store cookies from a contact on your website, you can pass that data to Script Manager, which responds appropriately to the contact setting. For example, if your contact responds with no consent, then Script Manager does not track activity for that contact.

Add the following JavaScript to the existing Bronto implementation on your website:

bronto('cookies:consent', consentEnabled);

where consentEnabled=true when your contact gives consent, and consentEnabled=false when your contact gives no consent.

Cookie Consent Example

A complete function to store and read the value for consentEnabled:

<script type="text/javascript"> 
 var brontoCookieConsent =  
  function updateCookieConsent(consentEnabled){ 
   bronto('cookies:consent', consentEnabled); 
   localStorage.setItem("brontoCookieConsent", brontoCookieConsent); 

Optional Buttons

Buttons to use on your webform or pop-up when you request cookie consent from your contact:

<input type="button" onclick="updateCookieConsent(true)" value="Opt-in cookies"/>
<input type="button" onclick="updateCookieConsent(false)" value="Opt-out cookies"/>