@@ -82,11 +82,11 @@ public function getPageTrackingCode($accountId)
82
82
83
83
$ anonymizeIp = "" ;
84
84
if ($ this ->_googleAnalyticsData ->isAnonymizedIpActive ()) {
85
- $ anonymizeIp = ", { 'anonymizeIp': true} " ;
85
+ $ anonymizeIp = "\n ga('set', 'anonymizeIp', true); " ;
86
86
}
87
87
88
88
return "\nga('create', ' " . $ this ->escapeHtmlAttr ($ accountId , false )
89
- . ", 'auto'); \nga('send', 'pageview' {$ optPageURL}{ $ anonymizeIp }); \n" ;
89
+ . ", 'auto'); { $ anonymizeIp } \nga('send', 'pageview' {$ optPageURL }); \n" ;
90
90
}
91
91
92
92
/**
@@ -111,11 +111,6 @@ public function getOrdersTrackingCode()
111
111
112
112
$ result [] = "ga('require', 'ec', 'ec.js'); " ;
113
113
114
- $ anonymizeIp = "" ;
115
- if ($ this ->_googleAnalyticsData ->isAnonymizedIpActive ()) {
116
- $ anonymizeIp = ", {'anonymizeIp': true} " ;
117
- }
118
-
119
114
foreach ($ collection as $ order ) {
120
115
if ($ order ->getIsVirtual ()) {
121
116
$ address = $ order ->getBillingAddress ();
@@ -153,7 +148,7 @@ public function getOrdersTrackingCode()
153
148
$ order ->getBaseShippingAmount ()
154
149
);
155
150
156
- $ result [] = "ga('send', 'pageview' { $ anonymizeIp } ); " ;
151
+ $ result [] = "ga('send', 'pageview'); " ;
157
152
}
158
153
return implode ("\n" , $ result );
159
154
}
0 commit comments