@blotoutio/providers-google-ads-clicks-sdk 1.2.0 → 1.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.
package/index.cjs.js CHANGED
@@ -378,7 +378,9 @@ const initGAds = (ID, consent, executionContext) => {
378
378
  };
379
379
  const init = ({ manifest, consentData, executionContext }) => {
380
380
  var _a, _b;
381
- if (!window || !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId'])) {
381
+ if (!window ||
382
+ !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId']) ||
383
+ manifest.variables['flowType'] === 'server') {
382
384
  return;
383
385
  }
384
386
  const customConfig = {
@@ -493,8 +495,8 @@ const getUserData = (destination) => {
493
495
  const handleTag = ({ data, eventName, manifestVariables, destination, }) => {
494
496
  if (!eventName ||
495
497
  !window.gtag ||
496
- !manifestVariables ||
497
- !manifestVariables['tagId']) {
498
+ !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId']) ||
499
+ manifestVariables['flowType'] === 'server') {
498
500
  return;
499
501
  }
500
502
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
@@ -552,7 +554,16 @@ const parseCookies = (cookie) => {
552
554
  };
553
555
 
554
556
  const tag = ({ data, eventName, manifestVariables, eventId, destination, }) => {
555
- const isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
557
+ let isLoaded;
558
+ if (manifestVariables['flowType'] === 'browser') {
559
+ isLoaded = true;
560
+ }
561
+ else if (manifestVariables['flowType'] === 'server') {
562
+ isLoaded = false;
563
+ }
564
+ else {
565
+ isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
566
+ }
556
567
  if (isLoaded) {
557
568
  handleTag({
558
569
  data,
@@ -564,7 +575,7 @@ const tag = ({ data, eventName, manifestVariables, eventId, destination, }) => {
564
575
  }
565
576
  return {
566
577
  loaded: isLoaded,
567
- sdkVersion: "1.2.0" ,
578
+ sdkVersion: "1.3.0" ,
568
579
  };
569
580
  };
570
581
 
package/index.js CHANGED
@@ -379,7 +379,9 @@ var ProvidersGoogleAdsClicksSdk = (function () {
379
379
  };
380
380
  const init = ({ manifest, consentData, executionContext }) => {
381
381
  var _a, _b;
382
- if (!window || !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId'])) {
382
+ if (!window ||
383
+ !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId']) ||
384
+ manifest.variables['flowType'] === 'server') {
383
385
  return;
384
386
  }
385
387
  const customConfig = {
@@ -494,8 +496,8 @@ var ProvidersGoogleAdsClicksSdk = (function () {
494
496
  const handleTag = ({ data, eventName, manifestVariables, destination, }) => {
495
497
  if (!eventName ||
496
498
  !window.gtag ||
497
- !manifestVariables ||
498
- !manifestVariables['tagId']) {
499
+ !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId']) ||
500
+ manifestVariables['flowType'] === 'server') {
499
501
  return;
500
502
  }
501
503
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
@@ -553,7 +555,16 @@ var ProvidersGoogleAdsClicksSdk = (function () {
553
555
  };
554
556
 
555
557
  const tag = ({ data, eventName, manifestVariables, eventId, destination, }) => {
556
- const isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
558
+ let isLoaded;
559
+ if (manifestVariables['flowType'] === 'browser') {
560
+ isLoaded = true;
561
+ }
562
+ else if (manifestVariables['flowType'] === 'server') {
563
+ isLoaded = false;
564
+ }
565
+ else {
566
+ isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
567
+ }
557
568
  if (isLoaded) {
558
569
  handleTag({
559
570
  data,
@@ -565,7 +576,7 @@ var ProvidersGoogleAdsClicksSdk = (function () {
565
576
  }
566
577
  return {
567
578
  loaded: isLoaded,
568
- sdkVersion: "1.2.0" ,
579
+ sdkVersion: "1.3.0" ,
569
580
  };
570
581
  };
571
582
 
package/index.mjs CHANGED
@@ -376,7 +376,9 @@ const initGAds = (ID, consent, executionContext) => {
376
376
  };
377
377
  const init = ({ manifest, consentData, executionContext }) => {
378
378
  var _a, _b;
379
- if (!window || !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId'])) {
379
+ if (!window ||
380
+ !((_a = manifest === null || manifest === void 0 ? void 0 : manifest.variables) === null || _a === void 0 ? void 0 : _a['tagId']) ||
381
+ manifest.variables['flowType'] === 'server') {
380
382
  return;
381
383
  }
382
384
  const customConfig = {
@@ -491,8 +493,8 @@ const getUserData = (destination) => {
491
493
  const handleTag = ({ data, eventName, manifestVariables, destination, }) => {
492
494
  if (!eventName ||
493
495
  !window.gtag ||
494
- !manifestVariables ||
495
- !manifestVariables['tagId']) {
496
+ !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId']) ||
497
+ manifestVariables['flowType'] === 'server') {
496
498
  return;
497
499
  }
498
500
  const conversionLabel = getConversionLabel(eventName, manifestVariables);
@@ -550,7 +552,16 @@ const parseCookies = (cookie) => {
550
552
  };
551
553
 
552
554
  const tag = ({ data, eventName, manifestVariables, eventId, destination, }) => {
553
- const isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
555
+ let isLoaded;
556
+ if (manifestVariables['flowType'] === 'browser') {
557
+ isLoaded = true;
558
+ }
559
+ else if (manifestVariables['flowType'] === 'server') {
560
+ isLoaded = false;
561
+ }
562
+ else {
563
+ isLoaded = window && window.gtag && !!getCookieValue('_gcl_au');
564
+ }
554
565
  if (isLoaded) {
555
566
  handleTag({
556
567
  data,
@@ -562,7 +573,7 @@ const tag = ({ data, eventName, manifestVariables, eventId, destination, }) => {
562
573
  }
563
574
  return {
564
575
  loaded: isLoaded,
565
- sdkVersion: "1.2.0" ,
576
+ sdkVersion: "1.3.0" ,
566
577
  };
567
578
  };
568
579
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-google-ads-clicks-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Google Ads Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",