@mparticle/web-google-tag-manager-kit 2.1.2 → 2.3.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.
@@ -23,6 +23,9 @@ var googleConsentProperties = [
23
23
  'ad_user_data',
24
24
  'ad_personalization',
25
25
  'analytics_storage',
26
+ 'functionality_storage',
27
+ 'personalization_storage',
28
+ 'security_storage',
26
29
  ];
27
30
 
28
31
  function ConsentHandler(common) {
@@ -58,6 +61,9 @@ ConsentHandler.prototype.getConsentSettings = function () {
58
61
  ad_personalization: 'defaultAdPersonalizationConsentWeb',
59
62
  ad_storage: 'defaultAdStorageConsentWeb',
60
63
  analytics_storage: 'defaultAnalyticsStorageConsentWeb',
64
+ functionality_storage: 'defaultFunctionalityStorageConsentWeb',
65
+ personalization_storage: 'defaultPersonalizationStorageConsentWeb',
66
+ security_storage: 'defaultSecurityStorageConsentWeb',
61
67
  };
62
68
 
63
69
  var settings = this.common.settings;
@@ -791,7 +797,8 @@ var initialization = {
791
797
  isInitialized = initializeContainer(
792
798
  containerId,
793
799
  common.customDataLayerName,
794
- previewUrl
800
+ previewUrl,
801
+ common.settings.preventAutoBlock
795
802
  );
796
803
  }
797
804
 
@@ -816,11 +823,15 @@ var initialization = {
816
823
  }
817
824
 
818
825
  common.maybeSendConsentUpdateToGoogle(updatedConsentState);
819
-
820
826
  },
821
827
  };
822
828
 
823
- function initializeContainer(containerId, dataLayerName, previewUrl) {
829
+ function initializeContainer(
830
+ containerId,
831
+ dataLayerName,
832
+ previewUrl,
833
+ preventAutoBlock
834
+ ) {
824
835
  var url = 'https://www.googletagmanager.com/gtm.js';
825
836
 
826
837
  // If Settings contains previewUrl, we should tack that onto the gtm snippet
@@ -835,21 +846,27 @@ function initializeContainer(containerId, dataLayerName, previewUrl) {
835
846
 
836
847
  url += '&l=' + dataLayerName;
837
848
 
838
- loadSnippet(url, dataLayerName);
849
+ loadSnippet(url, dataLayerName, preventAutoBlock);
839
850
 
840
851
  return true;
841
852
  }
842
853
 
843
- function loadSnippet(url, dataLayerName) {
854
+ function loadSnippet(url, dataLayerName, preventAutoBlock) {
844
855
  window[dataLayerName].push({
845
856
  'gtm.start': new Date().getTime(),
846
- event: 'gtm.js'
857
+ event: 'gtm.js',
847
858
  });
848
859
 
849
860
  var gTagScript = document.createElement('script');
850
861
  gTagScript.type = 'text/javascript';
851
862
  gTagScript.async = true;
852
863
  gTagScript.src = url;
864
+ if (preventAutoBlock === 'True') {
865
+ gTagScript.setAttributeNode(
866
+ window.document.createAttribute('data-ot-ignore')
867
+ );
868
+ }
869
+
853
870
  (
854
871
  document.getElementsByTagName('head')[0] ||
855
872
  document.getElementsByTagName('body')[0]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-google-tag-manager-kit",
3
- "version": "2.1.2",
3
+ "version": "2.3.0",
4
4
  "repository": "https://github.com/mparticle-integrations/mparticle-javascript-integration-google-tag-manager",
5
5
  "main": "dist/GoogleTagManager-Kit.common.js",
6
6
  "browser": "dist/GoogleTagManager-Kit.common.js",
@@ -15,13 +15,15 @@
15
15
  "testEndToEnd": "browserify node_modules/@mparticle/web-kit-wrapper/end-to-end-testapp/index.js -v -o test/end-to-end-testapp/build/compilation.js && open http://localhost:8082/node_modules/@mparticle/web-kit-wrapper/end-to-end-testapp/index.html && node node_modules/@mparticle/web-kit-wrapper/end-to-end-testapp/server"
16
16
  },
17
17
  "dependencies": {
18
- "@mparticle/web-sdk": "^2.11.1"
18
+ "@mparticle/web-sdk": "^2.58.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@mparticle/web-kit-wrapper": "^1.0.5",
22
- "@semantic-release/changelog": "^5.0.1",
23
- "@semantic-release/exec": "^5.0.0",
24
- "@semantic-release/git": "^9.0.0",
22
+ "@semantic-release/changelog": "^6.0.0",
23
+ "@semantic-release/exec": "^6.0.0",
24
+ "@semantic-release/git": "^10.0.0",
25
+ "@semantic-release/npm": "^13.0.0",
26
+ "semantic-release": "^24.2.0",
25
27
  "chai": "^4.3.4",
26
28
  "karma": "^5.1.0",
27
29
  "karma-chai": "^0.1.0",