Skip to content

Commit e851948

Browse files
committed
Updated code to make it more efficient.
1 parent 149d08f commit e851948

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

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

5655
// Process orders data
5756
if (config.ordersTrackingData.length) {
@@ -75,6 +74,9 @@ define([
7574
}
7675

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

0 commit comments

Comments
 (0)