Skip to content

Commit 5fd7481

Browse files
[2.3-develop] Forwardport of #13034
1 parent b7dc2b3 commit 5fd7481

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/GoogleAnalytics/view/frontend/web/js/google-analytics.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ define([
5151
if (config.pageTrackingData.isAnonymizedIpActive) {
5252
ga('set', 'anonymizeIp', true);
5353
}
54-
ga('send', 'pageview' + config.pageTrackingData.optPageUrl);
5554

5655
// Process orders data
57-
if (config.ordersTrackingData) {
56+
if (config.ordersTrackingData.length) {
5857
ga('require', 'ec', 'ec.js');
5958

6059
ga('set', 'currencyCode', config.ordersTrackingData.currency);
@@ -74,6 +73,9 @@ define([
7473
}
7574

7675
ga('send', 'pageview');
76+
} else {
77+
// Process Data if not orders
78+
ga('send', 'pageview' + config.pageTrackingData.optPageUrl);
7779
}
7880
}
7981
}

0 commit comments

Comments
 (0)