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 =  
 JSON.parse(localStorage.getItem("brontoCookieConsent"));
  function updateCookieConsent(consentEnabled){ 
   bronto('cookies:consent', consentEnabled); 
   localStorage.setItem("brontoCookieConsent", brontoCookieConsent); 
  } 
</script>

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"/>
<br/><br/>
<input type="button" onclick="updateCookieConsent(false)" value="Opt-out cookies"/>