Created
October 20, 2020 14:39
-
-
Save pingpoli/51f81a79ef26561423add59674f56570 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by default, personalized ads are turned off | |
var CCM_showPersonalizedAds = false; | |
// increase this number when your cookie policy has changed, this will show the popup to all users again | |
var CCM_versionNumber = 0; | |
function CCM_getCookieConsent( forceShow ) | |
{ | |
var consent = CCM_getCookie( "ccm_accepted_v"+CCM_versionNumber ); | |
if ( consent != "yes" || forceShow ) | |
{ | |
// if the consent form hasn't been shown to the user, show it | |
CCM_showPopup(); | |
} | |
else | |
{ | |
var personalizedAds = CCM_getCookie( "ccm_personalizedAds" ); | |
if ( personalizedAds == "yes" ) CCM_showPersonalizedAds = true; | |
// renew the cookies so frequent users don't get the popup all the time | |
CCM_setCookies( CCM_showPersonalizedAds ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment