Nom des cookies unique
This commit is contained in:
parent
bf9e887c00
commit
c004fec8c9
@ -231,17 +231,15 @@ core.start = function() {
|
||||
// Crée le cookie d'acceptation Google Analytics si nécessaire
|
||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||
<?php if( $analytics !== null AND $analytics !=='' ){
|
||||
$cookieName = 'ZWII_COOKIE_GA_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));?>
|
||||
$path = str_replace('index.php','',str_replace( '/','',$_SERVER['PHP_SELF']));?>
|
||||
if(ga.checked){
|
||||
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=true_<?php echo $path;?>;" + expires +";"+ samesite;
|
||||
}
|
||||
else{
|
||||
document.cookie = "<?php echo $cookieName; ?>=false;" + expires +";"+ samesite;
|
||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=false_<?php echo $path;?>;" + expires +";"+ samesite;
|
||||
}
|
||||
<?php }
|
||||
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||
?>
|
||||
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||
<?php } ?>
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true_<?php echo str_replace('index.php','',str_replace( '/','',$_SERVER['PHP_SELF'])); ?>;" + expires +";"+ samesite;
|
||||
});
|
||||
$("#cookieConsent .cookieClose").on("click", function() {
|
||||
$(this).parents("#cookieConsent").fadeOut();
|
||||
|
@ -1172,9 +1172,8 @@ 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($cookieName) === 'true') {
|
||||
$this->getInput('ZWII_COOKIE_GA_CONSENT') === 'true_'.str_replace('index.php','',str_replace( '/','',$_SERVER['PHP_SELF']))) {
|
||||
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
|
||||
<script>
|
||||
@ -1190,8 +1189,7 @@ class common {
|
||||
* Affiche le consentement aux cookies
|
||||
*/
|
||||
public function showCookies() {
|
||||
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||
if($this->getInput($cookieName) !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
||||
if($this->getInput('ZWII_COOKIE_CONSENT') !== 'true_'.str_replace('index.php','',str_replace( '/','',$_SERVER['PHP_SELF'])) AND $this->getData(['config','cookieConsent']) === true){ ?>
|
||||
<div id="cookieConsent">
|
||||
<div class="cookieClose">X</div>
|
||||
<h3><?php echo $this->getData(['config', 'cookies', 'cookiesTitleText']); ?></h3>
|
||||
|
Loading…
Reference in New Issue
Block a user