@blotoutio/providers-google-ads-clicks-sdk 1.67.0 → 1.68.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
@@ -908,42 +908,6 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
908
908
 
909
909
  const keyPrefix = `_worker`;
910
910
 
911
- const getCookieValue = (key) => {
912
- var _a;
913
- try {
914
- if (!document || !document.cookie) {
915
- return '';
916
- }
917
- const cookies = parseCookies(document.cookie);
918
- return (_a = cookies[key]) !== null && _a !== void 0 ? _a : '';
919
- }
920
- catch {
921
- return '';
922
- }
923
- };
924
- const parseCookies = (cookie) => {
925
- return Object.fromEntries(cookie
926
- .split(/;\s+/)
927
- .map((r) => r.split('=').map((str) => str.trim()))
928
- .map(([cookieKey, ...cookieValues]) => {
929
- const cookieValue = cookieValues.join('=');
930
- if (!cookieKey) {
931
- return [];
932
- }
933
- let decodedValue = '';
934
- if (cookieValue) {
935
- try {
936
- decodedValue = decodeURIComponent(cookieValue);
937
- }
938
- catch (e) {
939
- console.log(`Unable to decode cookie ${cookieKey}: ${e}`);
940
- decodedValue = cookieValue;
941
- }
942
- }
943
- return [cookieKey, decodedValue];
944
- }));
945
- };
946
-
947
911
  const initKey = `${keyPrefix}StoreMultiple`;
948
912
  const getData = (destination, persistType, key = initKey) => {
949
913
  let data;
@@ -1001,21 +965,21 @@ const getIsNewCustomerFromBrowser = (destination) => {
1001
965
  };
1002
966
 
1003
967
  const tag = ({ data, eventName, manifestVariables, destination, pageUrl, getEdgeData, }) => {
1004
- var _a;
968
+ var _a, _b;
1005
969
  const result = {
1006
970
  isFired: false,
1007
- sdkVersion: "1.67.0" ,
971
+ sdkVersion: "1.68.1" ,
1008
972
  };
1009
- if (!eventName || !window.gtag || !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'])) {
973
+ const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
974
+ if (!eventName || !window.gtag || !tagId) {
1010
975
  return result;
1011
976
  }
1012
- const hasCookie = getCookieValue('_gcl_au');
1013
977
  const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
1014
978
  (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
1015
- if (!shouldLoadSDK || !hasCookie) {
979
+ if (!shouldLoadSDK || !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId])) {
1016
980
  return result;
1017
981
  }
1018
- const resolvedPageUrl = pageUrl || ((_a = window.location) === null || _a === void 0 ? void 0 : _a.href);
982
+ const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
1019
983
  // Send dynamic remarketing event if enabled
1020
984
  sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
1021
985
  // Fire conversion event if loadSDK is enabled and conversion label exists
package/index.js CHANGED
@@ -909,42 +909,6 @@ var ProvidersGoogleAdsClicksSdk = (function () {
909
909
 
910
910
  const keyPrefix = `_worker`;
911
911
 
912
- const getCookieValue = (key) => {
913
- var _a;
914
- try {
915
- if (!document || !document.cookie) {
916
- return '';
917
- }
918
- const cookies = parseCookies(document.cookie);
919
- return (_a = cookies[key]) !== null && _a !== void 0 ? _a : '';
920
- }
921
- catch {
922
- return '';
923
- }
924
- };
925
- const parseCookies = (cookie) => {
926
- return Object.fromEntries(cookie
927
- .split(/;\s+/)
928
- .map((r) => r.split('=').map((str) => str.trim()))
929
- .map(([cookieKey, ...cookieValues]) => {
930
- const cookieValue = cookieValues.join('=');
931
- if (!cookieKey) {
932
- return [];
933
- }
934
- let decodedValue = '';
935
- if (cookieValue) {
936
- try {
937
- decodedValue = decodeURIComponent(cookieValue);
938
- }
939
- catch (e) {
940
- console.log(`Unable to decode cookie ${cookieKey}: ${e}`);
941
- decodedValue = cookieValue;
942
- }
943
- }
944
- return [cookieKey, decodedValue];
945
- }));
946
- };
947
-
948
912
  const initKey = `${keyPrefix}StoreMultiple`;
949
913
  const getData = (destination, persistType, key = initKey) => {
950
914
  let data;
@@ -1002,21 +966,21 @@ var ProvidersGoogleAdsClicksSdk = (function () {
1002
966
  };
1003
967
 
1004
968
  const tag = ({ data, eventName, manifestVariables, destination, pageUrl, getEdgeData, }) => {
1005
- var _a;
969
+ var _a, _b;
1006
970
  const result = {
1007
971
  isFired: false,
1008
- sdkVersion: "1.67.0" ,
972
+ sdkVersion: "1.68.1" ,
1009
973
  };
1010
- if (!eventName || !window.gtag || !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'])) {
974
+ const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
975
+ if (!eventName || !window.gtag || !tagId) {
1011
976
  return result;
1012
977
  }
1013
- const hasCookie = getCookieValue('_gcl_au');
1014
978
  const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
1015
979
  (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
1016
- if (!shouldLoadSDK || !hasCookie) {
980
+ if (!shouldLoadSDK || !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId])) {
1017
981
  return result;
1018
982
  }
1019
- const resolvedPageUrl = pageUrl || ((_a = window.location) === null || _a === void 0 ? void 0 : _a.href);
983
+ const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
1020
984
  // Send dynamic remarketing event if enabled
1021
985
  sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
1022
986
  // Fire conversion event if loadSDK is enabled and conversion label exists
package/index.mjs CHANGED
@@ -906,42 +906,6 @@ const init = ({ manifest, consentData, executionContext, pageUrl, }) => {
906
906
 
907
907
  const keyPrefix = `_worker`;
908
908
 
909
- const getCookieValue = (key) => {
910
- var _a;
911
- try {
912
- if (!document || !document.cookie) {
913
- return '';
914
- }
915
- const cookies = parseCookies(document.cookie);
916
- return (_a = cookies[key]) !== null && _a !== void 0 ? _a : '';
917
- }
918
- catch {
919
- return '';
920
- }
921
- };
922
- const parseCookies = (cookie) => {
923
- return Object.fromEntries(cookie
924
- .split(/;\s+/)
925
- .map((r) => r.split('=').map((str) => str.trim()))
926
- .map(([cookieKey, ...cookieValues]) => {
927
- const cookieValue = cookieValues.join('=');
928
- if (!cookieKey) {
929
- return [];
930
- }
931
- let decodedValue = '';
932
- if (cookieValue) {
933
- try {
934
- decodedValue = decodeURIComponent(cookieValue);
935
- }
936
- catch (e) {
937
- console.log(`Unable to decode cookie ${cookieKey}: ${e}`);
938
- decodedValue = cookieValue;
939
- }
940
- }
941
- return [cookieKey, decodedValue];
942
- }));
943
- };
944
-
945
909
  const initKey = `${keyPrefix}StoreMultiple`;
946
910
  const getData = (destination, persistType, key = initKey) => {
947
911
  let data;
@@ -999,21 +963,21 @@ const getIsNewCustomerFromBrowser = (destination) => {
999
963
  };
1000
964
 
1001
965
  const tag = ({ data, eventName, manifestVariables, destination, pageUrl, getEdgeData, }) => {
1002
- var _a;
966
+ var _a, _b;
1003
967
  const result = {
1004
968
  isFired: false,
1005
- sdkVersion: "1.67.0" ,
969
+ sdkVersion: "1.68.1" ,
1006
970
  };
1007
- if (!eventName || !window.gtag || !(manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'])) {
971
+ const tagId = manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['tagId'];
972
+ if (!eventName || !window.gtag || !tagId) {
1008
973
  return result;
1009
974
  }
1010
- const hasCookie = getCookieValue('_gcl_au');
1011
975
  const shouldLoadSDK = (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['loadSDK']) === '1' ||
1012
976
  (manifestVariables === null || manifestVariables === void 0 ? void 0 : manifestVariables['dynamicRemarketingEnabled']) === '1';
1013
- if (!shouldLoadSDK || !hasCookie) {
977
+ if (!shouldLoadSDK || !((_a = window.google_tag_manager) === null || _a === void 0 ? void 0 : _a[tagId])) {
1014
978
  return result;
1015
979
  }
1016
- const resolvedPageUrl = pageUrl || ((_a = window.location) === null || _a === void 0 ? void 0 : _a.href);
980
+ const resolvedPageUrl = pageUrl || ((_b = window.location) === null || _b === void 0 ? void 0 : _b.href);
1017
981
  // Send dynamic remarketing event if enabled
1018
982
  sendDynamicRemarketingEvent(eventName, manifestVariables, data, resolvedPageUrl);
1019
983
  // Fire conversion event if loadSDK is enabled and conversion label exists
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-google-ads-clicks-sdk",
3
- "version": "1.67.0",
3
+ "version": "1.68.1",
4
4
  "description": "Google Ads Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",