@mparticle/web-google-analytics-4-client-kit 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -587,21 +587,28 @@ EventHandler.prototype.logPageView = function (event) {
|
|
|
587
587
|
var TITLE = 'Google.Title';
|
|
588
588
|
var LOCATION = 'Google.Location';
|
|
589
589
|
var pageTitle, pageLocation;
|
|
590
|
-
|
|
590
|
+
|
|
591
|
+
if (event.CustomFlags && event.CustomFlags.hasOwnProperty(TITLE)) {
|
|
591
592
|
pageTitle = event.CustomFlags[TITLE];
|
|
592
593
|
} else {
|
|
593
594
|
pageTitle = document.title;
|
|
594
595
|
}
|
|
595
596
|
|
|
596
|
-
if (event.CustomFlags.hasOwnProperty(LOCATION)) {
|
|
597
|
+
if (event.CustomFlags && event.CustomFlags.hasOwnProperty(LOCATION)) {
|
|
597
598
|
pageLocation = event.CustomFlags[LOCATION];
|
|
598
599
|
} else {
|
|
599
600
|
pageLocation = location.href;
|
|
600
601
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
|
|
603
|
+
var eventAttributes = this.common.mergeObjects(
|
|
604
|
+
{
|
|
605
|
+
page_title: pageTitle,
|
|
606
|
+
page_location: pageLocation,
|
|
607
|
+
},
|
|
608
|
+
event.EventAttributes
|
|
609
|
+
);
|
|
610
|
+
|
|
611
|
+
gtag('event', 'page_view', eventAttributes);
|
|
605
612
|
|
|
606
613
|
return true;
|
|
607
614
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mparticle/web-google-analytics-4-client-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
|
|
5
5
|
"description": "mParticle integration sdk for Google Analytics",
|
|
6
6
|
"main": "dist/GoogleAnalytics4EventForwarderClientSide-Kit.common.js",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"repository": "https://github.com/mparticle-integrations/mparticle-javascript-integration-google-analytics-4/tree/master/packages/GA4Client",
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@mparticle/web-kit-wrapper": "^1.0.5",
|
|
23
|
+
"@semantic-release/changelog": "^5.0.1",
|
|
24
|
+
"@semantic-release/exec": "^5.0.0",
|
|
25
|
+
"@semantic-release/git": "^9.0.0",
|
|
23
26
|
"mocha": "^5.2.0",
|
|
24
27
|
"chai": "^4.2.0",
|
|
25
28
|
"karma": "^3.1.1",
|