modification du nom des cookies de consentement
This commit is contained in:
parent
9485c2ba5a
commit
12bec0e14f
@ -230,15 +230,18 @@ core.start = function() {
|
||||
expires = "expires=" + expires.toUTCString();
|
||||
// Crée le cookie d'acceptation Google Analytics si nécessaire
|
||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
||||
<?php if( $analytics !== null AND $analytics !=='' ){
|
||||
$cookieName = 'ZWII_COOKIE_GA_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));?>
|
||||
if(ga.checked){
|
||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=true;" + expires +";"+ samesite;
|
||||
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||
}
|
||||
else{
|
||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + expires +";"+ samesite;
|
||||
document.cookie = "<?php echo $cookieName; ?>=false;" + expires +";"+ samesite;
|
||||
}
|
||||
<?php } ?>
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true;" + expires +";"+ samesite;
|
||||
<?php }
|
||||
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||
?>
|
||||
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||
});
|
||||
$(".cookieBox .cookieClose").on("click", function() {
|
||||
$(this).parents("#cookieConsent").fadeOut();
|
||||
|
@ -1172,8 +1172,9 @@ class common {
|
||||
* Affiche le script Google Analytics
|
||||
*/
|
||||
public function showAnalytics() {
|
||||
$cookieName = 'ZWII_COOKIE_GA_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||
if( !empty($code = $this->getData(['config', 'seo', 'analyticsId'])) &&
|
||||
$this->getInput('ZWII_COOKIE_GA_CONSENT') === 'true') {
|
||||
$this->getInput($cookieName) === 'true') {
|
||||
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
|
||||
<script>
|
||||
@ -1189,7 +1190,8 @@ class common {
|
||||
* Affiche le consentement aux cookies
|
||||
*/
|
||||
public function showCookies() {
|
||||
if($this->getInput('ZWII_COOKIE_CONSENT') !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
||||
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||
if($this->getInput($cookieName) !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
||||
<div id="cookieConsent">
|
||||
<div class="cookieBox"><div class="cookieClose">X</div></div>
|
||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user