From d0a7d9a8539ac70afc65e4aa2b5662c14f7b3056 Mon Sep 17 00:00:00 2001 From: DanielSeifert Date: Tue, 20 Jan 2015 11:20:36 +0000 Subject: [PATCH] bounce optimization switch added (#3465) --- .../views/tpl/widget/d3_googleanalytics.tpl | 32 +++++++++++-------- .../views/tpl/widget/d3ga_universal.tpl | 32 +++++++++++-------- .../admin/de/d3_googleanalytics_lang.php | 3 ++ .../admin/en/d3_googleanalytics_lang.php | 3 ++ .../admin/tpl/d3_cfg_googleanalytics_main.tpl | 10 ++++++ 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3_googleanalytics.tpl b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3_googleanalytics.tpl index 93870dd..f7d9818 100644 --- a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3_googleanalytics.tpl +++ b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3_googleanalytics.tpl @@ -173,21 +173,27 @@ [{/if}] [{* bounce optimization*}] - setTimeout('_gaq.push([\'_trackEvent\', \'NoBounce\', \'Over defined seconds\'])',[{$oD3GASettings->getValue('iSendNoBounceEventTime')}]); + [{block name="d3ga_bounceoptimzation"}] + [{if $oD3GASettings->getValue('blUseBounceRateOptimization')}] + [{if $oD3GASettings->getValue('iSendNoBounceEventTime')}] + setTimeout('_gaq.push([\'_trackEvent\', \'NoBounce\', \'Over defined seconds\'])',[{$oD3GASettings->getValue('iSendNoBounceEventTime')}]); + [{/if}] - [{if $oD3GASettings->getValue('blSendNoBounceEventScroll')}] - window.addEventListener ? - window.addEventListener('scroll', testScroll, false) : - window.attachEvent('onscroll', testScroll); + [{if $oD3GASettings->getValue('blSendNoBounceEventScroll')}] + window.addEventListener ? + window.addEventListener('scroll', testScroll, false) : + window.attachEvent('onscroll', testScroll); - var scrollCount = 0; - function testScroll() { - ++scrollCount; - if (scrollCount == 2) { - _gaq.push(['_trackEvent', 'window', 'scrolled']); - } - } - [{/if}] + var scrollCount = 0; + function testScroll() { + ++scrollCount; + if (scrollCount == 2) { + _gaq.push(['_trackEvent', 'window', 'scrolled']); + } + } + [{/if}] + [{/if}] + [{/block}] (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; diff --git a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3ga_universal.tpl b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3ga_universal.tpl index 3b360b3..ca4f8f7 100644 --- a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3ga_universal.tpl +++ b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/d3ga_universal.tpl @@ -52,21 +52,27 @@ [{/if}] [{* bounce optimization*}] - setTimeout('ga(\'send\', \'event\', \'NoBounce\', \'Over defined seconds\')',[{$oD3GASettings->getValue('iSendNoBounceEventTime')}]); + [{block name="d3ga_bounceoptimzation"}] + [{if $oD3GASettings->getValue('blUseBounceRateOptimization')}] + [{if $oD3GASettings->getValue('iSendNoBounceEventTime')}] + setTimeout('ga(\'send\', \'event\', \'NoBounce\', \'Over defined seconds\')',[{$oD3GASettings->getValue('iSendNoBounceEventTime')}]); + [{/if}] - [{if $oD3GASettings->getValue('blSendNoBounceEventScroll')}] - window.addEventListener ? - window.addEventListener('scroll', testScroll, false) : - window.attachEvent('onscroll', testScroll); + [{if $oD3GASettings->getValue('blSendNoBounceEventScroll')}] + window.addEventListener ? + window.addEventListener('scroll', testScroll, false) : + window.attachEvent('onscroll', testScroll); - var scrollCount = 0; - function testScroll() { - ++scrollCount; - if (scrollCount == 2) { - ga('send', 'event', 'window', 'scrolled'); - } - } - [{/if}] + var scrollCount = 0; + function testScroll() { + ++scrollCount; + if (scrollCount == 2) { + ga('send', 'event', 'window', 'scrolled'); + } + } + [{/if}] + [{/if}] + [{/block}] ga('send', 'pageview' [{$sD3GASendPageViewParameter}]); diff --git a/copy_this/modules/d3/d3_googleanalytics/views/admin/de/d3_googleanalytics_lang.php b/copy_this/modules/d3/d3_googleanalytics/views/admin/de/d3_googleanalytics_lang.php index 49d5793..40ee9b7 100644 --- a/copy_this/modules/d3/d3_googleanalytics/views/admin/de/d3_googleanalytics_lang.php +++ b/copy_this/modules/d3/d3_googleanalytics/views/admin/de/d3_googleanalytics_lang.php @@ -112,6 +112,9 @@ $aLang = array( '

', 'D3_GOOGLEANALYTICS_BOUNCEOPT' => 'Absprungdaten optimieren', + 'D3_GOOGLEANALYTICS_BOUNCEOPT_SWITCH' => 'Absprungdaten-Optimierung aktivieren', + 'D3_GOOGLEANALYTICS_BOUNCEOPT_SWITCH_DESC' => 'Analytics wertet jeden Benutzer, der nicht '. + 'innerhalb der Seite einen Link anklickt, als Abbrecher. Mit dieser Option kann der Wert optimiert werden.', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT1' => 'Seitenbesucher nicht als Abbrecher werten nach', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT2' => 'Millisekunden (1000 = 1 Sekunde)', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT_DESC' => '

Analytics wertet alle Seitenbucher, die '. diff --git a/copy_this/modules/d3/d3_googleanalytics/views/admin/en/d3_googleanalytics_lang.php b/copy_this/modules/d3/d3_googleanalytics/views/admin/en/d3_googleanalytics_lang.php index 571e80a..d7ac5e5 100644 --- a/copy_this/modules/d3/d3_googleanalytics/views/admin/en/d3_googleanalytics_lang.php +++ b/copy_this/modules/d3/d3_googleanalytics/views/admin/en/d3_googleanalytics_lang.php @@ -112,6 +112,9 @@ $aLang = array( '

', 'D3_GOOGLEANALYTICS_BOUNCEOPT' => 'Bounce rate optimzation', + 'D3_GOOGLEANALYTICS_BOUNCEOPT_SWITCH' => 'Absprungdaten-Optimierung aktivieren', + 'D3_GOOGLEANALYTICS_BOUNCEOPT_SWITCH_DESC' => 'Analytics wertet jeden Benutzer, der nicht '. + 'innerhalb der Seite einen Link anklickt, als Abbrecher. Mit dieser Option kann der Wert optimiert werden.', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT1' => 'Seitenbesucher nicht als Abbrecher werten nach', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT2' => 'Millisekunden (1000 = 1 Sekunde)', 'D3_GOOGLEANALYTICS_BOUNCEOPT_SENDTIMEEVENT_DESC' => '

Analytics wertet alle Seitenbucher, die '. diff --git a/copy_this/modules/d3/d3_googleanalytics/views/admin/tpl/d3_cfg_googleanalytics_main.tpl b/copy_this/modules/d3/d3_googleanalytics/views/admin/tpl/d3_cfg_googleanalytics_main.tpl index 7191ca8..33b1dce 100644 --- a/copy_this/modules/d3/d3_googleanalytics/views/admin/tpl/d3_cfg_googleanalytics_main.tpl +++ b/copy_this/modules/d3/d3_googleanalytics/views/admin/tpl/d3_cfg_googleanalytics_main.tpl @@ -231,6 +231,16 @@ [{oxmultilang ident="D3_GOOGLEANALYTICS_BOUNCEOPT"}] +

+
+ +
+
+ + getValue('blUseBounceRateOptimization')}]checked[{/if}] name="value[blUseBounceRateOptimization]"> + [{oxinputhelp ident="D3_GOOGLEANALYTICS_BOUNCEOPT_SWITCH_DESC"}] +
+