Merge remote-tracking branch 'origin/rel_3.x' into rel_4.x

# Conflicts:
#	copy_this/modules/d3/d3_googleanalytics/metadata.php
#	copy_this/modules/d3/d3_googleanalytics/setup/d3_googleanalytics_update.php
#	copy_this/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_remarketing.tpl
#	setup+doku/Precheck/d3precheck.php
#	setup+doku/changelog.txt
This commit is contained in:
RayEhrhardt 2017-11-27 11:00:45 +01:00
commit 96a86ff730
13 changed files with 504 additions and 463 deletions

View File

@ -29,4 +29,19 @@ class d3_cfg_googleanalytics extends D3\ModCfg\Application\Controller\Admin\d3_c
$this->addTplParam('sMainClass', 'd3_cfg_googleanalytics_main');
return parent::render();
}
public function getAdditionalHeadContent()
{
$oViewConf = oxRegistry::getConfig()->getActiveView()->getViewConfig();
$sScriptUrl = $oViewConf->getModuleUrl('d3_googleanalytics', 'out/src/d3_googleanalytics_test.js');
return parent::getAdditionalHeadContent().'
<script src="'.$sScriptUrl.'"></script>
<script type="text/javascript">
if(null === document.getElementById("SePiRENuJOBWx")){
alert("'.oxRegistry::getLang()->translateString('D3_GOOGLEANALYTICS_ADBLOCKER', null, true).'");
}
</script>
';
}
}

View File

@ -31,7 +31,10 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
'details' => 'product',
'oxwarticledetails' => 'product',
'basket' => 'cart',
'order' => 'purchase',
'user' => 'cart',
'payment' => 'cart',
'order' => 'cart',
'thankyou' => 'purchase',
);
/**
@ -302,19 +305,29 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
}
/**
* Indicates the type of page that the tag is on. Valid values:
*
* home - Used on the home page or landing page of your site.
* searchresults - Used on pages where the results of a user's search are displayed.
* category - Used on pages that list multiple items within a category, for example a page showing all shoes in a given style.
* product - Used on individual product pages.
* cart - Used on the cart/basket/checkout page.
* purchase - Used on the page shown once a user has purchased (and so converted), for example a "Thank You" or confirmation page.
* other - Used where the page does not fit into the other types of page, for example a "Contact Us" or "About Us" page.
*
* @link https://developers.google.com/adwords-remarketing-tag/parameters#retail-sites
* @return string
*/
public function d3GetGAPageType()
{
$oCurrentView = oxRegistry::getConfig()->getActiveView();
if (is_array($this->aD3GAPageTypes) &&
isset($this->aD3GAPageTypes[strtolower($oCurrentView->getClassName())])
) {
return $this->aD3GAPageTypes[strtolower($oCurrentView->getClassName())];
$key = strtolower($oCurrentView->getClassName());
if (array_key_exists($key, $this->aD3GAPageTypes)) {
return $this->aD3GAPageTypes[$key];
};
return 'Siteview';
return 'other';
}
/**

View File

@ -0,0 +1,9 @@
if (null === document.body) {
// add body tag, if it's missing because framesets
var b=document.createElement('body');
document.getElementsByTagName('html')[0].appendChild(b);
}
var e=document.createElement('div');
e.id='SePiRENuJOBWx';
e.style.display='none';
document.body.appendChild(e);

View File

@ -408,6 +408,9 @@ $aLang = array(
'Sie in der <a href="https://www.google.de/search?q=Analytics+_opt+out+script" target="gahelp">Google-Suche'.
'</a>.</p>',
'D3_GOOGLEANALYTICS_ADBLOCKER' => 'AdBlocker entdeckt - Bitte deaktivieren Sie diesen für diese Seite, da sonst '.
'Teile des Admin-Bereichs nicht richtig geladen werden können.',
// Erweiterung des Links in der Fussnote "Hilfe Starten"
'D3_GOOGLEANALYTICS_HELPLINK' => 'Fragen-zu-speziellen-Modulen/Google-Analytics/',
);

View File

@ -408,6 +408,9 @@ $aLang = array(
'Sie in der <a href="https://www.google.de/search?q=Analytics+_opt+out+script" target="gahelp">Google-Suche'.
'</a>.</p>',
'D3_GOOGLEANALYTICS_ADBLOCKER' => 'AdBlocker detected - Please deactivate it for this page, because otherwise '.
'parts of the admin area can not be loaded correctly.',
// Erweiterung des Links in der Fussnote "Hilfe Starten"
'D3_GOOGLEANALYTICS_HELPLINK' => 'Fragen-zu-speziellen-Modulen/Google-Analytics/',
);

View File

@ -81,19 +81,14 @@
[{if $oD3GASettings->getValue('blD3GATrackPageLoadTime')}]
[{block name="d3ga_trackpageloadtime"}]
var perfData = window.performance.timing;
var pageLoadTime = perfData.domComplete - perfData.navigationStart;
var loadTime = "";
var pageLoadTime =
Math.round(
(
(perfData.domComplete > 0 ? perfData.domComplete : perfData.responseEnd) - perfData.navigationStart
) / 1000
);
if (pageLoadTime < 1000) { loadTime = "0-1 seconds"; }
else if (pageLoadTime < 2000) { loadTime = "1-2 seconds"; }
else if (pageLoadTime < 3000) { loadTime = "2-3 seconds"; }
else if (pageLoadTime < 4000) { loadTime = "3-4 seconds"; }
else if (pageLoadTime < 5000) { loadTime = "4-5 seconds"; }
else if (pageLoadTime < 6000) { loadTime = "5-6 seconds"; }
else if (pageLoadTime < 10000) { loadTime = "6-10 seconds"; }
else { loadTime = "10+ seconds"; }
ga('set', 'metric1', loadTime);
ga('set', 'metric1', pageLoadTime);
[{*ga('send', 'event', 'Page Load Time', loadTime, {'nonInteraction': true});*}]
[{/block}]
[{/if}]

View File

@ -13,7 +13,7 @@
var google_tag_params = {
ecomm_prodid: [{$sD3GARemarketingProdId}],
ecomm_pagetype: '[{$sD3GARemarketingPageType}]',
ecomm_totalvalue: '[{$sD3GARemarketingPrice}]'
ecomm_totalvalue: [{$sD3GARemarketingPrice}]
};
</script>
<script type="text/javascript">

View File

@ -1,6 +1,3 @@
=> 4.0.0.0
Oxid V6 Release
=> 3.4.0.0
- Remarketing (via Analytics) eingefügt
- Remarketing-Liste für Startseite eingefügt
@ -10,6 +7,12 @@ Oxid V6 Release
- Steuerberechnung korrigiert
- Scriptsyntax angepasst
=> 3.4.0.1
- #5078: ecomm_totalvalue darf nicht in Apostrophen stehen
- #4814: Remarketing: Werte für ecomm_pagetype anpassen
- #4509: changed_full entfernen
- AdBlock-Checker in Admin integriert, da dieser die Darstellung des Adminbereichs blockieren kann
=> 3.3.2.0
- fix: Optionen im Admin können nicht deaktivert werden
- "Zertifizierter Händler" im Shop aktivieren