Render Better takes protection of user privacy and user data very seriously. As such, one requirement of modern privacy protection regulations is to ensure that any cookie tracking of users does not occur until the user has explicitly given their consent. To ensure adherence to this requirement, Render Better provides tools you can use to opt-in to cookie and analytics tracking when the user has consented to be tracked via cookie consent popups.
How to grant consent for a session
There are many cookie compliance tools available that you can use. Once the user accepts cookies, you can run the following JavaScript code to grant consent for the current session:
if (window.renderbetter) { window.renderbetter.grantCookieConsent(true); }
To revoke cookie consent and stop sending analytics data to Render Better you can run the following command:
if (window.renderbetter) { window.renderbetter.grantCookieConsent(false); }
Examples:
CookiePro (OneTrust):
<script type="text/javascript">
/* Render Better Cookie Pro consent */
(function () {
const cookieGroup = 'C0002'; // Performance cookies
if (OptanonActiveGroups && OptanonActiveGroups.includes(cookieGroup)) {
renderbetter.grantCookieConsent(true);
} else {
renderbetter.grantCookieConsent(false);
}
window.addEventListener('consent.onetrust', function (event) {
if (event.detail?.includes(cookieGroup)) {
renderbetter.grantCookieConsent(true);
} else {
renderbetter.grantCookieConsent(false);
}
});
})();
</script>
CookieBot
<script type="text/javascript">
/* Render Better CookieBot consent */
window.addEventListener('CookiebotOnAccept', function (e) {
if (window.renderbetter) {
window.renderbetter.grantCookieConsent(true); // <-- Allow Render Better to collect data
}
}
</script>
Termly
<script type="text/javascript">
/* Render Better Termly consent */
(function () {
window.addEventListener('load', function checkTermlyConsent(){
if(window.Termly && window.Termly.getConsentState()) {
const groupIsActive = window.Termly?.getConsentState()?.performance;
if (groupIsActive !== undefined) {
window.renderbetter.grantCookieConsent(groupIsActive);
}
}
});
})();
</script>