From 0679a48823e2130d1ed807c212abf11f44a38527 Mon Sep 17 00:00:00 2001 From: Turqueso Date: Sat, 18 Mar 2017 11:48:34 -0700 Subject: [PATCH] Added Google Tag Manager to Google Tools Plugin --- bl-plugins/googletools/languages/de_CH.json | 4 +- bl-plugins/googletools/languages/de_DE.json | 4 +- bl-plugins/googletools/languages/en_US.json | 4 +- bl-plugins/googletools/languages/es_AR.json | 4 +- bl-plugins/googletools/languages/ja_JP.json | 4 +- bl-plugins/googletools/languages/nl_NL.json | 4 +- bl-plugins/googletools/languages/pl_PL.json | 4 +- bl-plugins/googletools/languages/ru_RU.json | 4 +- bl-plugins/googletools/languages/tr_TR.json | 4 +- bl-plugins/googletools/languages/uk_UA.json | 4 +- bl-plugins/googletools/plugin.php | 44 +++++++++++++++++---- 11 files changed, 67 insertions(+), 17 deletions(-) diff --git a/bl-plugins/googletools/languages/de_CH.json b/bl-plugins/googletools/languages/de_CH.json index 2e43271d..1b466871 100644 --- a/bl-plugins/googletools/languages/de_CH.json +++ b/bl-plugins/googletools/languages/de_CH.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmasters Tools", "google-analytics-tracking-id": "Google Analytics ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Gib hier den Google Analytics-Tracking-Code ein, um zu bestätigen, dass die Website Dir gehört.", - "complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein." + "complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein.", + "complete-this-field-with-the-tracking-id-google-tag": "Gib hier die Tracking ID ein." } diff --git a/bl-plugins/googletools/languages/de_DE.json b/bl-plugins/googletools/languages/de_DE.json index 8b3abce9..4147b8c9 100644 --- a/bl-plugins/googletools/languages/de_DE.json +++ b/bl-plugins/googletools/languages/de_DE.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmasters Tools", "google-analytics-tracking-id": "Google Analytics ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Gib hier den Google Analytics-Tracking-Code ein, um zu bestätigen, dass die Website Dir gehört.", - "complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein." + "complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein.", + "complete-this-field-with-the-tracking-id-google-tag": "Gib hier die Tracking ID ein." } \ No newline at end of file diff --git a/bl-plugins/googletools/languages/en_US.json b/bl-plugins/googletools/languages/en_US.json index 28cd8570..2d3ef48b 100644 --- a/bl-plugins/googletools/languages/en_US.json +++ b/bl-plugins/googletools/languages/en_US.json @@ -7,6 +7,8 @@ "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "Google Analytics Tracking ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Complete this field with the Google Site verification to verify the site owner.", - "complete-this-field-with-the-tracking-id": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Analytics." + "complete-this-field-with-the-tracking-id": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Analytics.", + "complete-this-field-with-the-tracking-id-google-tag": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Tag Manager." } \ No newline at end of file diff --git a/bl-plugins/googletools/languages/es_AR.json b/bl-plugins/googletools/languages/es_AR.json index 9ffa450f..1ca58dd5 100644 --- a/bl-plugins/googletools/languages/es_AR.json +++ b/bl-plugins/googletools/languages/es_AR.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "Google Analytics Tracking ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Complete este campo con el código de verificación de Google Webmasters Tools para verificar la propiedad del sitio.", - "complete-this-field-with-the-tracking-id": "Complete este campo con el Tracking ID para generar el código Javascript para trackear el sitio." + "complete-this-field-with-the-tracking-id": "Complete este campo con el Tracking ID para generar el código Javascript para trackear el sitio.", + "complete-this-field-with-the-tracking-id-google-tag": "Complete este campo con el Tracking ID para generar el código Javascript para Google Tag Manager." } \ No newline at end of file diff --git a/bl-plugins/googletools/languages/ja_JP.json b/bl-plugins/googletools/languages/ja_JP.json index 4c577039..589d48b3 100644 --- a/bl-plugins/googletools/languages/ja_JP.json +++ b/bl-plugins/googletools/languages/ja_JP.json @@ -7,6 +7,8 @@ "google-webmasters-tools": "Google Search Console", "google-analytics-tracking-id": "Google Analytics トラッキングID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Google Seach Consoleがサイト所有権を確認するためのメタタグを入力します。", - "complete-this-field-with-the-tracking-id": "Google Analyticsがトラッキングをするために生成したトラッキングIDを入力します。" + "complete-this-field-with-the-tracking-id": "Google Analyticsがトラッキングをするために生成したトラッキングIDを入力します。", + "complete-this-field-with-the-tracking-id-google-tag": "トラッキングをするために生成したトラッキングIDを入力します。" } \ No newline at end of file diff --git a/bl-plugins/googletools/languages/nl_NL.json b/bl-plugins/googletools/languages/nl_NL.json index fc0006e6..77442c22 100644 --- a/bl-plugins/googletools/languages/nl_NL.json +++ b/bl-plugins/googletools/languages/nl_NL.json @@ -7,6 +7,8 @@ "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "Google Analytics Tracking ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Vul dit veld in met de Google Site verificatie om jezelf te verifiëren als site beheerder.", - "complete-this-field-with-the-tracking-id": "Vul dit veld in met de Tracking ID om de Javascript tracking code te genereren voor Google Analytics." + "complete-this-field-with-the-tracking-id": "Vul dit veld in met de Tracking ID om de Javascript tracking code te genereren voor Google Analytics.", + "complete-this-field-with-the-tracking-id-google-tag": "Vul dit veld in met de Tracking ID." } diff --git a/bl-plugins/googletools/languages/pl_PL.json b/bl-plugins/googletools/languages/pl_PL.json index a20abd2c..6de199f8 100644 --- a/bl-plugins/googletools/languages/pl_PL.json +++ b/bl-plugins/googletools/languages/pl_PL.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "Google Analytics Tracking ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Complete this field with the Google Site verification to verify the site owner.", - "complete-this-field-with-the-tracking-id": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Analytics." + "complete-this-field-with-the-tracking-id": "Complete this field with the Tracking ID to generate the Javascript tracking code for Google Analytics.", + "complete-this-field-with-the-tracking-id-google-tag": "Complete this field with the ID" } \ No newline at end of file diff --git a/bl-plugins/googletools/languages/ru_RU.json b/bl-plugins/googletools/languages/ru_RU.json index ea455cb9..5e1869f1 100644 --- a/bl-plugins/googletools/languages/ru_RU.json +++ b/bl-plugins/googletools/languages/ru_RU.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "Google Analytics Tracking ID", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Заполните это поле для проверки владельца сайта.", - "complete-this-field-with-the-tracking-id": "Заполните это поле с Tracking ID чтобы сгенерировать код Javascript для отслеживания в Google Analytics." + "complete-this-field-with-the-tracking-id": "Заполните это поле с Tracking ID чтобы сгенерировать код Javascript для отслеживания в Google Analytics.", + "complete-this-field-with-the-tracking-id-google-tag": "Заполните это поле с Tracking ID чтобы сгенерировать код Javascript для." } diff --git a/bl-plugins/googletools/languages/tr_TR.json b/bl-plugins/googletools/languages/tr_TR.json index fee59988..84047bd4 100644 --- a/bl-plugins/googletools/languages/tr_TR.json +++ b/bl-plugins/googletools/languages/tr_TR.json @@ -6,6 +6,8 @@ }, "google-webmasters-tools": "Google Webmaster Araçları", "google-analytics-tracking-id": "Google Analytics İzleme No", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Google Site Doğrulama ile bu alanı doldurarak sitenizi doğrulayın", - "complete-this-field-with-the-tracking-id": "Bu alanı İzleme No ile doldurarak Google Analytics için Javascript kodu oluşturun." + "complete-this-field-with-the-tracking-id": "Bu alanı İzleme No ile doldurarak Google Analytics için Javascript kodu oluşturun.", + "complete-this-field-with-the-tracking-id-google-tag": "Bu alanı İzleme No ile doldurarak için Javascript kodu oluşturun." } diff --git a/bl-plugins/googletools/languages/uk_UA.json b/bl-plugins/googletools/languages/uk_UA.json index b4b55051..47a0b9de 100644 --- a/bl-plugins/googletools/languages/uk_UA.json +++ b/bl-plugins/googletools/languages/uk_UA.json @@ -7,6 +7,8 @@ "google-webmasters-tools": "Google Webmasters tools", "google-analytics-tracking-id": "КОД відстеження Google Analytics", + "google-tag-manager": "Google Tag Manager", "complete-this-field-with-the-google-site-verification": "Заповніть це поле для перевірки власника сайту.", - "complete-this-field-with-the-tracking-id": "Заповніть це поле для генерації Javascript-коду відстеження у Google Analytics." + "complete-this-field-with-the-tracking-id": "Заповніть це поле для генерації Javascript-коду відстеження у Google Analytics.", + "complete-this-field-with-the-tracking-id-google-tag": "Заповніть це поле для генерації Javascript-коду відстеження." } \ No newline at end of file diff --git a/bl-plugins/googletools/plugin.php b/bl-plugins/googletools/plugin.php index 34c93996..b79066b0 100644 --- a/bl-plugins/googletools/plugin.php +++ b/bl-plugins/googletools/plugin.php @@ -6,7 +6,8 @@ class pluginGoogleTools extends Plugin { { $this->dbFields = array( 'tracking-id'=>'', - 'google-site-verification'=>'' + 'google-site-verification'=>'', + 'google-tag-manager'=>'' ); } @@ -26,23 +27,52 @@ class pluginGoogleTools extends Plugin { $html .= '
'.$Language->get('complete-this-field-with-the-tracking-id').'
'; $html .= ''; + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= '
'.$Language->get('complete-this-field-with-the-tracking-id-google-tag').'
'; + $html .= '
'; + return $html; } public function siteHead() { global $Url; - - if(Text::isEmpty($this->getDbField('google-site-verification')) || !($Url->whereAmI()=='home')) { - return false; + + $html = ''; + + if((!empty($this->getDbField('google-site-verification'))) && ($Url->whereAmI()=='home')) { + $html .= PHP_EOL.''.PHP_EOL; + $html .= ''.PHP_EOL; + } + + if(!(Text::isEmpty($this->getDbField('google-tag-manager')))) { + $html .= PHP_EOL."".PHP_EOL; + $html .= "".PHP_EOL; + $html .= "".PHP_EOL; } - - $html = PHP_EOL.''.PHP_EOL; - $html .= ''.PHP_EOL; return $html; } + public function siteBodyBegin() + { + if((Text::isEmpty($this->getDbField('google-tag-manager')))) { + return false; + } + + $html = ''.PHP_EOL; + $html .= ''.PHP_EOL; + $html .= ''.PHP_EOL; + + return $html; + } + public function siteBodyEnd() { $html = PHP_EOL.''.PHP_EOL;