@mparticle/web-google-analytics-4-client-kit 1.0.6 → 1.1.0
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.
|
@@ -755,6 +755,7 @@ var identityHandler = IdentityHandler;
|
|
|
755
755
|
|
|
756
756
|
var initialization = {
|
|
757
757
|
name: 'GoogleAnalytics4',
|
|
758
|
+
moduleId: 160,
|
|
758
759
|
/* ****** Fill out initForwarder to load your SDK ******
|
|
759
760
|
Note that not all arguments may apply to your SDK initialization.
|
|
760
761
|
These are passed from mParticle, but leave them even if they are not being used.
|
|
@@ -773,6 +774,8 @@ var initialization = {
|
|
|
773
774
|
isInitialized,
|
|
774
775
|
common
|
|
775
776
|
) {
|
|
777
|
+
mParticle._setIntegrationDelay(this.moduleId, true);
|
|
778
|
+
|
|
776
779
|
common.forwarderSettings = forwarderSettings;
|
|
777
780
|
var measurementId = forwarderSettings.measurementId;
|
|
778
781
|
var userIdType = forwarderSettings.externalUserIdentityType;
|
|
@@ -801,6 +804,10 @@ var initialization = {
|
|
|
801
804
|
}
|
|
802
805
|
gtag('config', measurementId, configSettings);
|
|
803
806
|
|
|
807
|
+
gtag('get', measurementId, 'client_id', function (clientId) {
|
|
808
|
+
setClientId(clientId, initialization.moduleId);
|
|
809
|
+
});
|
|
810
|
+
|
|
804
811
|
if (!testMode) {
|
|
805
812
|
var clientScript = document.createElement('script');
|
|
806
813
|
clientScript.type = 'text/javascript';
|
|
@@ -829,6 +836,17 @@ var initialization = {
|
|
|
829
836
|
},
|
|
830
837
|
};
|
|
831
838
|
|
|
839
|
+
function setClientId(clientId, moduleId) {
|
|
840
|
+
var GA4CLIENTID = 'client_id';
|
|
841
|
+
var ga4IntegrationAttributes = {};
|
|
842
|
+
ga4IntegrationAttributes[GA4CLIENTID] = clientId;
|
|
843
|
+
window.mParticle.setIntegrationAttribute(
|
|
844
|
+
moduleId,
|
|
845
|
+
ga4IntegrationAttributes
|
|
846
|
+
);
|
|
847
|
+
window.mParticle._setIntegrationDelay(moduleId, false);
|
|
848
|
+
}
|
|
849
|
+
|
|
832
850
|
var initialization_1 = initialization;
|
|
833
851
|
|
|
834
852
|
var sessionHandler = {
|
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.1.0",
|
|
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",
|
|
@@ -25,22 +25,23 @@
|
|
|
25
25
|
"@semantic-release/changelog": "^5.0.1",
|
|
26
26
|
"@semantic-release/exec": "^5.0.0",
|
|
27
27
|
"@semantic-release/git": "^9.0.0",
|
|
28
|
-
"mocha": "^5.2.0",
|
|
29
28
|
"chai": "^4.2.0",
|
|
29
|
+
"eslint": "^7.25.0",
|
|
30
|
+
"eslint-config-prettier": "8.3.0",
|
|
31
|
+
"eslint-plugin-prettier": "3.4.1",
|
|
30
32
|
"karma": "^5.1.0",
|
|
31
33
|
"karma-chai": "^0.1.0",
|
|
32
34
|
"karma-chrome-launcher": "^3.1.0",
|
|
33
35
|
"karma-firefox-launcher": "^1.3.0",
|
|
34
36
|
"karma-mocha": "^2.0.1",
|
|
37
|
+
"mocha": "^5.2.0",
|
|
38
|
+
"prettier": "^2.4.1",
|
|
35
39
|
"rollup": "^1.15.6",
|
|
36
40
|
"rollup-plugin-commonjs": "^10.0.0",
|
|
37
41
|
"rollup-plugin-node-resolve": "^5.0.3",
|
|
38
42
|
"shelljs": "0.8.3",
|
|
39
|
-
"eslint": "^7.25.0",
|
|
40
|
-
"eslint-config-prettier": "8.3.0",
|
|
41
|
-
"eslint-plugin-prettier": "3.4.1",
|
|
42
43
|
"should": "13.2.3",
|
|
43
|
-
"
|
|
44
|
+
"sinon": "^15.1.0",
|
|
44
45
|
"watchify": "^3.11.0"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|