2011-02-27 00:25:02 +01:00
|
|
|
<?php
|
|
|
|
|
2012-12-21 11:20:32 +01:00
|
|
|
/**
|
|
|
|
* This module is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This module is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* For further informations, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
* @link http://www.shopmodule.com
|
2013-02-21 14:49:05 +01:00
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
2012-12-21 11:20:32 +01:00
|
|
|
*/
|
|
|
|
|
2013-02-21 14:51:41 +01:00
|
|
|
class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_parent
|
2011-02-27 00:25:02 +01:00
|
|
|
{
|
2011-02-27 21:21:16 +01:00
|
|
|
private $_sModId = 'd3_googleanalytics';
|
2012-12-21 11:17:54 +01:00
|
|
|
|
2014-05-09 10:40:33 +02:00
|
|
|
public $aD3GAPageTypes = array(
|
|
|
|
'start' => 'home',
|
|
|
|
'search' => 'searchresults',
|
|
|
|
'alist' => 'category',
|
|
|
|
'manufacturerlist' => 'category',
|
|
|
|
'vendorlist' => 'category',
|
|
|
|
'details' => 'product',
|
|
|
|
'basket' => 'cart',
|
|
|
|
'order' => 'purchase',
|
|
|
|
);
|
|
|
|
|
|
|
|
public $sD3GARemarketingSKUField = 'oxartnum';
|
|
|
|
public $blD3GARemarketingUseBrutto = true;
|
|
|
|
|
2012-12-21 11:20:32 +01:00
|
|
|
/**
|
|
|
|
* @return null
|
|
|
|
*/
|
2011-02-27 00:25:02 +01:00
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
$ret = parent::render();
|
|
|
|
|
2014-05-09 10:40:33 +02:00
|
|
|
$oSet = d3_cfg_mod::get($this->_d3getModId());
|
|
|
|
|
2014-06-05 11:21:20 +02:00
|
|
|
if ($oSet->isActive()) {
|
|
|
|
/** @var $oParentView oxView */
|
|
|
|
$oParentView = $this->getParent();
|
|
|
|
$oParentView->addTplParam('blD3GoogleAnalyticsActive', $oSet->isActive());
|
|
|
|
$oParentView->addTplParam('oD3GASettings', $oSet);
|
|
|
|
$oParentView->addTplParam('sD3GATTpl', $this->d3getGATTpl());
|
|
|
|
$oParentView->addTplParam('sD3GACreateParameter', $this->d3getCreateParameters());
|
|
|
|
$oParentView->addTplParam('sAFEGetMoreUrls', $this->afGetMoreUrls());
|
|
|
|
$oParentView->addTplParam('sD3GASendPageViewParameter', $this->d3getSendPageViewParameters());
|
|
|
|
$oParentView->addTplParam('sD3CurrentShopUrl', $this->d3GetCreateCurrentShopUrl());
|
|
|
|
|
|
|
|
if ($oSet->getValue('blD3GASetRemarketing')) {
|
|
|
|
$aInfos = $this->d3GetGAProdInfos();
|
|
|
|
$oParentView->addTplParam('sD3GARemarketingProdId', $this->d3GetGAProdIdList($aInfos['aArtIdList']));
|
|
|
|
$oParentView->addTplParam(
|
|
|
|
'sD3GARemarketingPrice',
|
|
|
|
$aInfos['dPrice'] > 0 ? number_format($aInfos['dPrice'], 2, '.', ''): ''
|
|
|
|
);
|
|
|
|
$oParentView->addTplParam('sD3GARemarketingPageType', $this->d3GetGAPageType());
|
|
|
|
}
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
2011-02-27 00:25:02 +01:00
|
|
|
return $ret;
|
|
|
|
}
|
2013-02-21 14:49:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2013-04-24 12:40:35 +02:00
|
|
|
private function _d3getModId()
|
2013-02-21 14:49:05 +01:00
|
|
|
{
|
|
|
|
return $this->_sModId;
|
|
|
|
}
|
2014-05-02 16:58:43 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function d3getGATTpl()
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('sD3GAType') == 'async') {
|
|
|
|
return 'd3_googleanalytics.tpl';
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'd3ga_universal.tpl';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2014-06-05 11:21:20 +02:00
|
|
|
public function d3GetCreateCurrentShopUrl()
|
2014-05-02 16:58:43 +02:00
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('blD3GAAllowDomainLinker')) {
|
2014-06-05 11:21:20 +02:00
|
|
|
return 'auto';
|
2014-05-02 16:58:43 +02:00
|
|
|
}
|
2014-06-05 11:21:20 +02:00
|
|
|
|
|
|
|
return oxRegistry::getConfig()->getActiveShop()->getFieldData('oxurl');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function afGetMoreUrls()
|
|
|
|
{
|
|
|
|
if (false == d3_cfg_mod::get($this->_sModId)->getValue('blD3GAAllowDomainLinker')) {
|
|
|
|
return '';
|
2014-05-05 16:49:37 +02:00
|
|
|
}
|
2014-06-05 11:21:20 +02:00
|
|
|
|
|
|
|
$sSeparator = ',';
|
|
|
|
|
|
|
|
return implode($sSeparator, $this->_d3GetNonBaseLanguageUrls());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetNonBaseLanguageUrls()
|
|
|
|
{
|
|
|
|
$myConfig = oxRegistry::getConfig();
|
|
|
|
$aLanguageUrls = $myConfig->getConfigParam('aLanguageURLs');
|
2014-07-24 11:21:40 +02:00
|
|
|
$aSslLanguageUrls = $myConfig->getConfigParam('aLanguageSSLURLs');
|
2014-06-05 11:21:20 +02:00
|
|
|
|
2014-07-24 11:21:40 +02:00
|
|
|
$aUrls = array();
|
2014-06-05 11:21:20 +02:00
|
|
|
if ($myConfig->getConfigParam('bl_perfLoadLanguages')) {
|
|
|
|
$aLanguages = oxRegistry::getLang()->getLanguageArray(null, true, true);
|
|
|
|
reset($aLanguages);
|
2014-07-24 11:21:40 +02:00
|
|
|
foreach ($aLanguages as $oVal) {
|
|
|
|
$aUrls = $this->_d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls);
|
2014-06-05 11:21:20 +02:00
|
|
|
}
|
2014-05-05 15:50:01 +02:00
|
|
|
}
|
2014-05-02 16:58:43 +02:00
|
|
|
|
2014-06-05 11:21:20 +02:00
|
|
|
return $aUrls;
|
|
|
|
}
|
|
|
|
|
2014-07-24 11:21:40 +02:00
|
|
|
/**
|
|
|
|
* @param $aLanguageUrls
|
|
|
|
* @param $oVal
|
|
|
|
* @param $aSslLanguageUrls
|
|
|
|
* @param $aUrls
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls)
|
|
|
|
{
|
|
|
|
$sUrl = str_replace('http://', '', $aLanguageUrls[$oVal->id]);
|
|
|
|
$sSslUrl = str_replace('https://', '', $aSslLanguageUrls[$oVal->id]);
|
|
|
|
|
|
|
|
if ($aLanguageUrls[$oVal->id] != $aLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) {
|
|
|
|
$aUrls[] = "'" . $sUrl . "'";
|
|
|
|
}
|
|
|
|
if ($aSslLanguageUrls[$oVal->id] != $aSslLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) {
|
|
|
|
$aUrls[] = "'" . $sSslUrl . "'";
|
|
|
|
|
|
|
|
return $aUrls;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aUrls;
|
|
|
|
}
|
|
|
|
|
2014-06-05 11:21:20 +02:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function d3getCreateParameters()
|
|
|
|
{
|
|
|
|
$aParameter = array();
|
|
|
|
|
|
|
|
$aParameter = $this->_d3getCreateDomainNameParameter($aParameter);
|
|
|
|
$aParameter = $this->_d3getCreateCookiePathParameter($aParameter);
|
|
|
|
$aParameter = $this->_d3getCreateDomainLinkerParameter($aParameter);
|
|
|
|
$aParameter = $this->_d3getCreateSpeedSamplerateParameter($aParameter);
|
|
|
|
$aParameter = $this->_d3getCreateSamplerateParameter($aParameter);
|
|
|
|
|
2014-05-02 16:58:43 +02:00
|
|
|
if (count($aParameter)) {
|
|
|
|
return ", {".implode(',', $aParameter)."}";
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function d3getSendPageViewParameters()
|
2014-05-05 15:50:01 +02:00
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('sD3GAType') == 'async') {
|
|
|
|
return $this->_d3getAsyncSendpageViewParameters();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->_d3getUniversalSendPageViewParameters();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
protected function _d3getAsyncSendpageViewParameters()
|
2014-05-02 16:58:43 +02:00
|
|
|
{
|
|
|
|
$aParameter = array();
|
|
|
|
|
2014-05-05 15:50:01 +02:00
|
|
|
/** @var oxUBase $oCurrentView */
|
|
|
|
$oCurrentView = oxRegistry::getConfig()->getActiveView();
|
|
|
|
$oCurrentView->getIsOrderStep();
|
|
|
|
|
2014-06-05 11:21:20 +02:00
|
|
|
$aParameter = $this->_d3getAsynchSendpageViewClassParameter($oCurrentView, $aParameter);
|
2014-05-05 15:50:01 +02:00
|
|
|
|
|
|
|
if (count($aParameter)) {
|
|
|
|
return ", " . implode(',', $aParameter) . "";
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
2014-05-05 15:50:01 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
protected function _d3getUniversalSendPageViewParameters()
|
|
|
|
{
|
|
|
|
$aParameter = array();
|
|
|
|
|
|
|
|
/** @var oxUBase $oCurrentView */
|
|
|
|
$oCurrentView = oxRegistry::getConfig()->getActiveView();
|
|
|
|
$oCurrentView->getIsOrderStep();
|
|
|
|
|
2014-06-05 11:21:20 +02:00
|
|
|
$aParameter = $this->_d3getUniversalSendPageViewPageParameter($oCurrentView, $aParameter);
|
|
|
|
$aParameter = $this->_d3getUniversalSendPageViewDebugParameter($aParameter);
|
2014-05-02 16:58:43 +02:00
|
|
|
|
|
|
|
if (count($aParameter)) {
|
2014-05-05 15:50:01 +02:00
|
|
|
return ", {" . implode(',', $aParameter) . "}";
|
2014-05-02 16:58:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
}
|
2014-05-09 10:40:33 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
protected function _d3HasNoPageParameter()
|
|
|
|
{
|
|
|
|
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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())];
|
|
|
|
};
|
|
|
|
|
|
|
|
return 'Siteview';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function d3GetGAProdInfos()
|
|
|
|
{
|
|
|
|
startProfile(__METHOD__);
|
|
|
|
|
|
|
|
$oCurrentView = oxRegistry::getConfig()->getActiveView();
|
|
|
|
|
|
|
|
$aArticleIds = array();
|
|
|
|
$dPrice = 0;
|
|
|
|
|
|
|
|
$sMethodName = '_d3GetGA'.$oCurrentView->getClassName()."ProdList";
|
|
|
|
|
|
|
|
if (method_exists($this, $sMethodName)) {
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
return call_user_func(array($this, $sMethodName), $oCurrentView);
|
|
|
|
}
|
|
|
|
|
|
|
|
stopProfile(__METHOD__);
|
|
|
|
|
|
|
|
return array('aArtIdList' => $aArticleIds, 'dPrice' => $dPrice);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $aArticleIds
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function d3GetGAProdIdList($aArticleIds)
|
|
|
|
{
|
|
|
|
if (count($aArticleIds)) {
|
|
|
|
return "['".implode("', '", $aArticleIds)."']";
|
|
|
|
} else {
|
|
|
|
return "''";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param details $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAdetailsProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = array();
|
|
|
|
$aArticleList[] = $oView->getProduct();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param alist $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAalistProdList($oView)
|
|
|
|
{
|
|
|
|
$oArticleList = $oView->getArticleList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($oArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param search $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAsearchProdList($oView)
|
|
|
|
{
|
|
|
|
$oArticleList = $oView->getArticleList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($oArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param vendorlist $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAvendorlistProdList($oView)
|
|
|
|
{
|
|
|
|
$oArticleList = $oView->getArticleList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($oArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param manufacturerlist $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAmanufacturerlistProdList($oView)
|
|
|
|
{
|
|
|
|
$oArticleList = $oView->getArticleList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($oArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param basket $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAbasketProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = $oView->getBasketArticles();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param order $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAorderProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = $oView->getBasketArticles();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param compare $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAcompareProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = $oView->getCompArtList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-06-05 11:21:20 +02:00
|
|
|
* don't change method name, it was dynamically generated
|
2014-05-09 10:40:33 +02:00
|
|
|
* @param account_noticelist $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAaccount_noticelistProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = $oView->getNoticeProductList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-06-05 11:21:20 +02:00
|
|
|
* don't change method name, it was dynamically generated
|
2014-05-09 10:40:33 +02:00
|
|
|
* @param account_wishlist $oView
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3GetGAaccount_wishlistProdList($oView)
|
|
|
|
{
|
|
|
|
$aArticleList = $oView->getWishProductList();
|
2014-07-04 10:46:17 +02:00
|
|
|
return $this->_d3GetGAProductList($aArticleList);
|
2014-05-09 10:40:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aArticleList
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2014-07-04 10:46:17 +02:00
|
|
|
protected function _d3GetGAProductList($aArticleList)
|
2014-05-09 10:40:33 +02:00
|
|
|
{
|
|
|
|
$aArticleIds = array();
|
|
|
|
$dPrice = 0;
|
|
|
|
|
|
|
|
/** @var oxarticle $oArticle */
|
|
|
|
if (isset($aArticleList)) {
|
|
|
|
foreach ($aArticleList as $oArticle) {
|
|
|
|
$aArticleIds[] = $oArticle->getFieldData($this->sD3GARemarketingSKUField);
|
|
|
|
if ($this->blD3GARemarketingUseBrutto) {
|
|
|
|
$dPrice += $oArticle->getPrice()->getBruttoPrice();
|
|
|
|
} else {
|
|
|
|
$dPrice += $oArticle->getPrice()->getNettoPrice();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return array('aArtIdList' => $aArticleIds, 'dPrice' => $dPrice);
|
|
|
|
}
|
2014-06-05 11:21:20 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getCreateDomainNameParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('sD3GASetDomainName')) {
|
|
|
|
$aParameter[] = "'cookieDomain': '" . d3_cfg_mod::get($this->_sModId)->getValue('sD3GASetDomainName') . "'";
|
|
|
|
$aParameter[] = "'legacyCookieDomain': '" .
|
|
|
|
d3_cfg_mod::get($this->_sModId)->getValue('sD3GASetDomainName') . "'";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getCreateCookiePathParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('sD3GASetCookiePath')) {
|
|
|
|
$aParameter[] = "'cookiePath': '" . d3_cfg_mod::get($this->_sModId)->getValue('sD3GASetCookiePath') . "'";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getCreateDomainLinkerParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('blD3GAAllowDomainLinker')) {
|
|
|
|
$aParameter[] = "'allowLinker': true";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getCreateSpeedSamplerateParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('iD3GASiteSpeedSampleRate')) {
|
|
|
|
$aParameter[] = "'siteSpeedSampleRate': " .
|
|
|
|
d3_cfg_mod::get($this->_sModId)->getValue('iD3GASiteSpeedSampleRate');
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getCreateSamplerateParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->getValue('iD3GASampleRate')) {
|
|
|
|
$aParameter[] = "'sampleRate': " . d3_cfg_mod::get($this->_sModId)->getValue('iD3GASampleRate');
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param oxUBase $oCurrentView
|
|
|
|
* @param array $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getAsynchSendpageViewClassParameter($oCurrentView, $aParameter)
|
|
|
|
{
|
|
|
|
if ($oCurrentView->getIsOrderStep() ||
|
|
|
|
strtolower($oCurrentView->getClassName()) == 'thankyou' ||
|
|
|
|
$this->_d3HasNoPageParameter()
|
|
|
|
) {
|
|
|
|
$aParameter[] = "'/{$oCurrentView->getClassName()}.html'";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param oxUBase $oCurrentView
|
|
|
|
* @param array $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getUniversalSendPageViewPageParameter($oCurrentView, $aParameter)
|
|
|
|
{
|
|
|
|
if ($oCurrentView->getIsOrderStep() || strtolower($oCurrentView->getClassName()) == 'thankyou') {
|
|
|
|
$aParameter[] = "'page': '/{$oCurrentView->getClassName()}.html'";
|
|
|
|
$aParameter[] = "'title': 'Checkout: " . ucfirst($oCurrentView->getClassName()) . "'";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
} elseif ($this->_d3HasNoPageParameter()) {
|
|
|
|
$aParameter[] = "'page': '/{$oCurrentView->getClassName()}.html'";
|
|
|
|
$aParameter[] = "'title': '" . ucfirst($oCurrentView->getClassName()) . "'";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $aParameter
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function _d3getUniversalSendPageViewDebugParameter($aParameter)
|
|
|
|
{
|
|
|
|
if (d3_cfg_mod::get($this->_sModId)->hasDebugMode()) {
|
|
|
|
$aParameter[] = "
|
|
|
|
'hitCallback': function() {
|
|
|
|
alert('analytics.js done sending data');
|
|
|
|
}
|
|
|
|
";
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $aParameter;
|
|
|
|
}
|
2014-05-02 16:58:43 +02:00
|
|
|
}
|