@blotoutio/providers-google-ads-clicks-sdk 1.24.2 → 1.25.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.
package/index.cjs.js CHANGED
@@ -411,11 +411,9 @@ const getGoogleConsent = (consentData) => {
411
411
  // eslint-disable-next-line @nx/enforce-module-boundaries
412
412
  const initGAds = (ID, consentData, executionContext, consentSkip) => {
413
413
  var _a;
414
- window.dataLayer = window.dataLayer || [];
415
- window.gtag = function gtag() {
416
- // eslint-disable-next-line prefer-rest-params
417
- window.dataLayer.push(arguments);
418
- };
414
+ if (!window.gtag) {
415
+ return;
416
+ }
419
417
  if (consentSkip != '1') {
420
418
  let isConsentInitialised = false;
421
419
  for (const otherProvider of ['googleAdsClicks', 'googleAnalytics4']) {
@@ -462,6 +460,11 @@ const init = ({ manifest, consentData, executionContext }) => {
462
460
  if (((_b = manifest.variables) === null || _b === void 0 ? void 0 : _b['enhancedConversionsSetting']) === 'gtag') {
463
461
  customConfig['allow_enhanced_conversions'] = true;
464
462
  }
463
+ window.dataLayer = window.dataLayer || [];
464
+ window.gtag = function gtag() {
465
+ // eslint-disable-next-line prefer-rest-params
466
+ window.dataLayer.push(arguments);
467
+ };
465
468
  if (!window.google_tag_manager ||
466
469
  !window.google_tag_manager[manifest.variables['tagId']]) {
467
470
  initGAds(manifest.variables['tagId'], consentData, executionContext, (_c = manifest.variables) === null || _c === void 0 ? void 0 : _c['consentSkip']);
@@ -607,14 +610,14 @@ const tag = ({ data, eventName, manifestVariables, destination, }) => {
607
610
  !getCookieValue('_gcl_au')) {
608
611
  return {
609
612
  isFired: false,
610
- sdkVersion: "1.24.2" ,
613
+ sdkVersion: "1.25.0" ,
611
614
  };
612
615
  }
613
616
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
614
617
  if (!conversionLabel) {
615
618
  return {
616
619
  isFired: false,
617
- sdkVersion: "1.24.2" ,
620
+ sdkVersion: "1.25.0" ,
618
621
  };
619
622
  }
620
623
  if (manifestVariables['enhancedConversionsSetting'] === 'gtag' &&
@@ -631,7 +634,7 @@ const tag = ({ data, eventName, manifestVariables, destination, }) => {
631
634
  });
632
635
  return {
633
636
  isFired: true,
634
- sdkVersion: "1.24.2" ,
637
+ sdkVersion: "1.25.0" ,
635
638
  };
636
639
  };
637
640
 
package/index.js CHANGED
@@ -412,11 +412,9 @@ var ProvidersGoogleAdsClicksSdk = (function () {
412
412
  // eslint-disable-next-line @nx/enforce-module-boundaries
413
413
  const initGAds = (ID, consentData, executionContext, consentSkip) => {
414
414
  var _a;
415
- window.dataLayer = window.dataLayer || [];
416
- window.gtag = function gtag() {
417
- // eslint-disable-next-line prefer-rest-params
418
- window.dataLayer.push(arguments);
419
- };
415
+ if (!window.gtag) {
416
+ return;
417
+ }
420
418
  if (consentSkip != '1') {
421
419
  let isConsentInitialised = false;
422
420
  for (const otherProvider of ['googleAdsClicks', 'googleAnalytics4']) {
@@ -463,6 +461,11 @@ var ProvidersGoogleAdsClicksSdk = (function () {
463
461
  if (((_b = manifest.variables) === null || _b === void 0 ? void 0 : _b['enhancedConversionsSetting']) === 'gtag') {
464
462
  customConfig['allow_enhanced_conversions'] = true;
465
463
  }
464
+ window.dataLayer = window.dataLayer || [];
465
+ window.gtag = function gtag() {
466
+ // eslint-disable-next-line prefer-rest-params
467
+ window.dataLayer.push(arguments);
468
+ };
466
469
  if (!window.google_tag_manager ||
467
470
  !window.google_tag_manager[manifest.variables['tagId']]) {
468
471
  initGAds(manifest.variables['tagId'], consentData, executionContext, (_c = manifest.variables) === null || _c === void 0 ? void 0 : _c['consentSkip']);
@@ -608,14 +611,14 @@ var ProvidersGoogleAdsClicksSdk = (function () {
608
611
  !getCookieValue('_gcl_au')) {
609
612
  return {
610
613
  isFired: false,
611
- sdkVersion: "1.24.2" ,
614
+ sdkVersion: "1.25.0" ,
612
615
  };
613
616
  }
614
617
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
615
618
  if (!conversionLabel) {
616
619
  return {
617
620
  isFired: false,
618
- sdkVersion: "1.24.2" ,
621
+ sdkVersion: "1.25.0" ,
619
622
  };
620
623
  }
621
624
  if (manifestVariables['enhancedConversionsSetting'] === 'gtag' &&
@@ -632,7 +635,7 @@ var ProvidersGoogleAdsClicksSdk = (function () {
632
635
  });
633
636
  return {
634
637
  isFired: true,
635
- sdkVersion: "1.24.2" ,
638
+ sdkVersion: "1.25.0" ,
636
639
  };
637
640
  };
638
641
 
package/index.mjs CHANGED
@@ -409,11 +409,9 @@ const getGoogleConsent = (consentData) => {
409
409
  // eslint-disable-next-line @nx/enforce-module-boundaries
410
410
  const initGAds = (ID, consentData, executionContext, consentSkip) => {
411
411
  var _a;
412
- window.dataLayer = window.dataLayer || [];
413
- window.gtag = function gtag() {
414
- // eslint-disable-next-line prefer-rest-params
415
- window.dataLayer.push(arguments);
416
- };
412
+ if (!window.gtag) {
413
+ return;
414
+ }
417
415
  if (consentSkip != '1') {
418
416
  let isConsentInitialised = false;
419
417
  for (const otherProvider of ['googleAdsClicks', 'googleAnalytics4']) {
@@ -460,6 +458,11 @@ const init = ({ manifest, consentData, executionContext }) => {
460
458
  if (((_b = manifest.variables) === null || _b === void 0 ? void 0 : _b['enhancedConversionsSetting']) === 'gtag') {
461
459
  customConfig['allow_enhanced_conversions'] = true;
462
460
  }
461
+ window.dataLayer = window.dataLayer || [];
462
+ window.gtag = function gtag() {
463
+ // eslint-disable-next-line prefer-rest-params
464
+ window.dataLayer.push(arguments);
465
+ };
463
466
  if (!window.google_tag_manager ||
464
467
  !window.google_tag_manager[manifest.variables['tagId']]) {
465
468
  initGAds(manifest.variables['tagId'], consentData, executionContext, (_c = manifest.variables) === null || _c === void 0 ? void 0 : _c['consentSkip']);
@@ -605,14 +608,14 @@ const tag = ({ data, eventName, manifestVariables, destination, }) => {
605
608
  !getCookieValue('_gcl_au')) {
606
609
  return {
607
610
  isFired: false,
608
- sdkVersion: "1.24.2" ,
611
+ sdkVersion: "1.25.0" ,
609
612
  };
610
613
  }
611
614
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
612
615
  if (!conversionLabel) {
613
616
  return {
614
617
  isFired: false,
615
- sdkVersion: "1.24.2" ,
618
+ sdkVersion: "1.25.0" ,
616
619
  };
617
620
  }
618
621
  if (manifestVariables['enhancedConversionsSetting'] === 'gtag' &&
@@ -629,7 +632,7 @@ const tag = ({ data, eventName, manifestVariables, destination, }) => {
629
632
  });
630
633
  return {
631
634
  isFired: true,
632
- sdkVersion: "1.24.2" ,
635
+ sdkVersion: "1.25.0" ,
633
636
  };
634
637
  };
635
638
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-google-ads-clicks-sdk",
3
- "version": "1.24.2",
3
+ "version": "1.25.0",
4
4
  "description": "Google Ads Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",