From 4f36f0ca35ae90da7d0192edc61d18ce6205d887 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 26 May 2021 14:46:51 +0000 Subject: [PATCH] wait #4493 @0:20 --- inc/ws/Metier/class.ws.book.parametres.php | 3 ++- .../html5/master/class.ws.html5.compiler.php | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 82cbc8daa..49e5237e4 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -221,9 +221,10 @@ class wsBookParametres extends wsParametres /** * */ $this->fields['stats'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les statistiques Fluidbook'), 'grade' => 3); $this->fields['googleAnalytics'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Code Google Analytics'), 'size' => 10); + $this->fields['googleTagManager'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Code Google Tag Manager'), 'size' => 10); $this->forms['basicStats'] = [ 'label' => __('Statistiques'), - 'fieldsnames' => ['stats', 'googleAnalytics'], + 'fieldsnames' => ['stats', 'googleAnalytics', 'googleTagManager'], ]; $this->fields['email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 94a7fb5ac..5398af101 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -541,7 +541,7 @@ class wsHTML5Compiler } $this->config->product_zoom_references = []; - foreach ($this->config->basketReferences as $ref => $data){ + foreach ($this->config->basketReferences as $ref => $data) { $this->config->product_zoom_references[$ref] = [$ref]; } } @@ -895,6 +895,20 @@ class wsHTML5Compiler $this->config->tagcommander_plan = $fixedplan; } } + if (isset($this->book->parametres->googleTagManager) && $this->book->parametres->googleTagManager) { + $this->book->parametres->googleAnalyticsCustom .= " + + +"; + $this->book->parametres->statsCustom = ' + +'; + } } protected function writeSecure() -- 2.39.5