diff --git a/Sources/Google Analytics-Installation.docx b/Sources/Google Analytics-Installation.docx
index 9898f12..df28269 100644
Binary files a/Sources/Google Analytics-Installation.docx and b/Sources/Google Analytics-Installation.docx differ
diff --git a/changed_full/470-/modules/d3/d3_googleanalytics/views/blocks/layout/d3_base_googleadwordscode.tpl b/changed_full/470-/modules/d3/d3_googleanalytics/views/blocks/layout/d3_base_googleadwordscode.tpl
index 626c837..cf930f4 100644
--- a/changed_full/470-/modules/d3/d3_googleanalytics/views/blocks/layout/d3_base_googleadwordscode.tpl
+++ b/changed_full/470-/modules/d3/d3_googleanalytics/views/blocks/layout/d3_base_googleadwordscode.tpl
@@ -6,6 +6,21 @@
[{if $mod_d3_googleanalytics}]
[{* Content shouldn't rendered in disabled module!
Because of this reason, it can't included in d3modcfgcheck block. *}]
+
+ [{if $oD3GASettings->getValue('sD3GATSActive') && $oD3GASettings->getValue('sD3GATSId')}]
+ [{capture name="d3GATrustedStoreCode"}]
+ [{strip}]
+ [{include file="d3ga_universal_trustedstore.tpl"}]
+ [{/strip}]
+ [{/capture}]
+
+ [{if $oViewConf->getActiveClassName() == 'thankyou'}]
+ [{$oView->logCode($smarty.capture.d3GATrustedStoreCode)}]
+ [{/if}]
+
+ [{$smarty.capture.d3GATrustedStoreCode}]
+ [{/if}]
+
[{include file="d3ga_universal_adwordscode.tpl"}]
[{include file="d3ga_universal_remarketing.tpl"}]
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 143b43c..3b360b3 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
@@ -70,6 +70,8 @@
ga('send', 'pageview' [{$sD3GASendPageViewParameter}]);
+ [{include file="d3ga_universal_ecommerce.tpl"}]
+
[{if $oD3GASettings->getValue('blD3GATrackPageLoadTime')}]
var perfData = window.performance.timing;
var pageLoadTime = perfData.domComplete - perfData.navigationStart;
@@ -87,8 +89,6 @@
ga('set', 'metric1', loadTime);
[{*ga('send', 'event', 'Page Load Time', loadTime, {'nonInteraction': true});*}]
[{/if}]
-
- [{include file="d3ga_universal_ecommerce.tpl"}]
[{/strip}]
@@ -99,8 +99,4 @@
[{/if}]
[{$smarty.capture.d3GATrackCode}]
-[{/if}]
-
-[{if $blD3GoogleAnalyticsActive && $oD3GASettings->getValue('sD3GATSActive') && $oD3GASettings->getValue('sD3GATSId')}]
- [{include file="d3ga_universal_trustedstore.tpl"}]
[{/if}]
\ No newline at end of file
diff --git a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_ecommerce.tpl b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_ecommerce.tpl
index b342b35..b11a469 100644
--- a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_ecommerce.tpl
+++ b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_ecommerce.tpl
@@ -1,7 +1,7 @@
[{if $oD3GASettings->getValue('blD3GASendECommerce') && $oViewConf->getActiveClassName() == 'thankyou'}][{strip}]
[{assign var="order" value=$oView->getOrder()}]
- ga('require', 'ecommerce', 'ecommerce.js');
+ ga('require', 'ecommerce');
[{assign var="currate" value=$order->oxorder__oxcurrate->value}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
diff --git a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_trustedstore.tpl b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_trustedstore.tpl
index 7a05f39..c91d843 100644
--- a/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_trustedstore.tpl
+++ b/changed_full/470-/modules/d3/d3_googleanalytics/views/tpl/widget/inc/d3ga_universal_trustedstore.tpl
@@ -30,7 +30,7 @@
[{assign var="oOrder" value=$oView->getOrder()}]
[{assign var="oOrderCurrency" value=$oOrder->getOrderCurrency()}]
[{assign var="oUser" value=$oOrder->getOrderUser()}]
- [{assign var="oUserCountry" value=$oUser->getUserCountry()}]
+ [{assign var="oUserCountry" value=$oD3GACountry}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="sTotal" value=$oOrder->getOrderNetSum()}] [{* // total - required - has to be gross sum *}]
[{else}]
@@ -43,21 +43,20 @@
[{$oOrder->getFieldData('oxordernr')}]
[{$oxcmp_shop->oxshops__oxurl->value}]
[{$oUser->getFieldData('oxusername')}]
- [{$oCountry->getFieldData('OXISOALPHA2')}]
+ [{$oUserCountry->getFieldData('oxisoalpha2')}]
[{$oOrderCurrency->name}]
[{$sTotal|string_format:"%.2f"}]
-[{$oOrder->getFieldData('oxdiscount')}]
[{$oOrder->getFieldData('oxdelcost')}]
[{math equation="fi + se + th + fo" fi=$oOrder->getFieldData('oxartvatprice1') se=$oOrder->getFieldData('oxartvatprice2') th=$oOrder->getFieldData('oxpayvat') fo=$oOrder->getFieldData('oxdelvat') format="%.2f"}]
- MERCHANT_ORDER_ID
- MERCHANT_ORDER_ID
- MERCHANT_ORDER_ID
- MERCHANT_ORDER_ID
+ has_completed
+ has_completed
+ has_completed
+ has_completed
[{foreach from=$order->getOrderArticles() item=oOrderArticle}]
-
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="oPrice" value=$oOrderArticle->getPrice()}]
[{assign var="sPrice" value=$oPrice->getNettoPrice()}]
diff --git a/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php b/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php
index 6a8059f..1fc1271 100644
--- a/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php
+++ b/copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics.php
@@ -56,6 +56,7 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
$oParentView->addTplParam('sD3GASendPageViewParameter', $this->d3getSendPageViewParameters());
$oParentView->addTplParam('sD3CurrentShopUrl', $this->d3GetCreateCurrentShopUrl());
$oParentView->addTplParam('sD3CurrentGTSLang', $this->d3GetGTSLang());
+ $oParentView->addTplParam('oD3GACountry', $this->d3GAGetUserCountry());
if ($oSet->getValue('blD3GASetRemarketing')) {
$aInfos = $this->d3GetGAProdInfos();
@@ -620,4 +621,22 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
return $aParameter;
}
+
+ /**
+ * @return oxcountry
+ */
+ public function d3GAGetUserCountry()
+ {
+ /** @var thankyou $oCurrentView */
+ $oCurrentView = oxRegistry::getConfig()->getActiveView();
+ /** @var oxcountry $oCountry */
+ $oCountry = oxNew('oxcountry');
+
+ if (method_exists($oCurrentView, 'getOrder')) {
+ $sCountryId = $oCurrentView->getOrder()->getFieldData('oxbillcountryid');
+ $oCountry->load($sCountryId);
+ }
+
+ return $oCountry;
+ }
}
diff --git a/setup+doku/Google Analytics-Installation.pdf b/setup+doku/Google Analytics-Installation.pdf
index db6b4b3..6946197 100644
Binary files a/setup+doku/Google Analytics-Installation.pdf and b/setup+doku/Google Analytics-Installation.pdf differ