@blotoutio/providers-google-analytics-4-sdk 0.29.0 → 0.30.1

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.
package/index.cjs.js CHANGED
@@ -1,5 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ const packageName = 'googleAnalytics4';
4
+ const tagManagerUrl = 'https://www.googletagmanager.com/gtag/js';
5
+
6
+ // eslint-disable-next-line @nx/enforce-module-boundaries
3
7
  const initGA4 = (ID) => {
4
8
  window.dataLayer = window.dataLayer || [];
5
9
  window.gtag = function gtag() {
@@ -11,7 +15,7 @@ const initGA4 = (ID) => {
11
15
  window.gtag('js', new Date());
12
16
  const element = document.createElement('script');
13
17
  element.async = !0;
14
- element.src = `https://www.googletagmanager.com/gtag/js?id=${ID}`;
18
+ element.src = `${tagManagerUrl}?id=${ID}`;
15
19
  const script = document.getElementsByTagName('script')[0];
16
20
  if (script && script.parentNode) {
17
21
  script.parentNode.insertBefore(element, script);
@@ -264,12 +268,13 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
264
268
  }
265
269
  return {
266
270
  loaded: isLoaded,
267
- sdkVersion: "0.29.0" ,
271
+ sdkVersion: "0.30.1" ,
268
272
  };
269
273
  };
270
274
 
275
+ // eslint-disable-next-line @nx/enforce-module-boundaries
271
276
  const data = {
272
- name: 'googleAnalytics4',
277
+ name: packageName,
273
278
  init,
274
279
  tag,
275
280
  };
package/index.js CHANGED
@@ -1,6 +1,10 @@
1
1
  var ProvidersGoogleAnalytics4Sdk = (function () {
2
2
  'use strict';
3
3
 
4
+ const packageName = 'googleAnalytics4';
5
+ const tagManagerUrl = 'https://www.googletagmanager.com/gtag/js';
6
+
7
+ // eslint-disable-next-line @nx/enforce-module-boundaries
4
8
  const initGA4 = (ID) => {
5
9
  window.dataLayer = window.dataLayer || [];
6
10
  window.gtag = function gtag() {
@@ -12,7 +16,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
12
16
  window.gtag('js', new Date());
13
17
  const element = document.createElement('script');
14
18
  element.async = !0;
15
- element.src = `https://www.googletagmanager.com/gtag/js?id=${ID}`;
19
+ element.src = `${tagManagerUrl}?id=${ID}`;
16
20
  const script = document.getElementsByTagName('script')[0];
17
21
  if (script && script.parentNode) {
18
22
  script.parentNode.insertBefore(element, script);
@@ -265,12 +269,13 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
265
269
  }
266
270
  return {
267
271
  loaded: isLoaded,
268
- sdkVersion: "0.29.0" ,
272
+ sdkVersion: "0.30.1" ,
269
273
  };
270
274
  };
271
275
 
276
+ // eslint-disable-next-line @nx/enforce-module-boundaries
272
277
  const data = {
273
- name: 'googleAnalytics4',
278
+ name: packageName,
274
279
  init,
275
280
  tag,
276
281
  };
package/index.mjs CHANGED
@@ -1,3 +1,7 @@
1
+ const packageName = 'googleAnalytics4';
2
+ const tagManagerUrl = 'https://www.googletagmanager.com/gtag/js';
3
+
4
+ // eslint-disable-next-line @nx/enforce-module-boundaries
1
5
  const initGA4 = (ID) => {
2
6
  window.dataLayer = window.dataLayer || [];
3
7
  window.gtag = function gtag() {
@@ -9,7 +13,7 @@ const initGA4 = (ID) => {
9
13
  window.gtag('js', new Date());
10
14
  const element = document.createElement('script');
11
15
  element.async = !0;
12
- element.src = `https://www.googletagmanager.com/gtag/js?id=${ID}`;
16
+ element.src = `${tagManagerUrl}?id=${ID}`;
13
17
  const script = document.getElementsByTagName('script')[0];
14
18
  if (script && script.parentNode) {
15
19
  script.parentNode.insertBefore(element, script);
@@ -262,12 +266,13 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
262
266
  }
263
267
  return {
264
268
  loaded: isLoaded,
265
- sdkVersion: "0.29.0" ,
269
+ sdkVersion: "0.30.1" ,
266
270
  };
267
271
  };
268
272
 
273
+ // eslint-disable-next-line @nx/enforce-module-boundaries
269
274
  const data = {
270
- name: 'googleAnalytics4',
275
+ name: packageName,
271
276
  init,
272
277
  tag,
273
278
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-google-analytics-4-sdk",
3
- "version": "0.29.0",
3
+ "version": "0.30.1",
4
4
  "description": "Google Analytics 4 Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",