@blotoutio/providers-facebook-sdk 1.28.1 → 1.30.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
@@ -310,7 +310,8 @@ const snippet = () => {
310
310
  script.parentNode.insertBefore(element, script);
311
311
  }
312
312
  };
313
- const init = ({ manifest, userId }) => {
313
+ const init = ({ manifest, userId, consentData }) => {
314
+ var _a;
314
315
  if (!manifest.variables ||
315
316
  !manifest.variables['pixelId'] ||
316
317
  manifest.variables['enableBrowser'] !== '1') {
@@ -318,6 +319,11 @@ const init = ({ manifest, userId }) => {
318
319
  }
319
320
  snippet();
320
321
  runInit(manifest.variables['pixelId'], manifest.variables['ldu'] === '1', userId);
322
+ if (((_a = consentData === null || consentData === void 0 ? void 0 : consentData.consent) === null || _a === void 0 ? void 0 : _a.facebook) || (consentData === null || consentData === void 0 ? void 0 : consentData.categories.advertising)) {
323
+ if (window.clientParamsHelper) {
324
+ window.clientParamsHelper.collectAndSetParams(true);
325
+ }
326
+ }
321
327
  };
322
328
 
323
329
  const getProductIdFromMapping = (item, productIdMapping) => {
@@ -404,7 +410,7 @@ const prepareData = (data, productIdMapping) => {
404
410
  };
405
411
  const tag = ({ data, eventName, manifestVariables, eventId }) => {
406
412
  const payload = {
407
- sdkVersion: "1.28.1" ,
413
+ sdkVersion: "1.30.0" ,
408
414
  };
409
415
  if (window.fbq &&
410
416
  !!manifestVariables['pixelId'] &&
package/index.js CHANGED
@@ -311,7 +311,8 @@ var ProvidersFacebookSdk = (function () {
311
311
  script.parentNode.insertBefore(element, script);
312
312
  }
313
313
  };
314
- const init = ({ manifest, userId }) => {
314
+ const init = ({ manifest, userId, consentData }) => {
315
+ var _a;
315
316
  if (!manifest.variables ||
316
317
  !manifest.variables['pixelId'] ||
317
318
  manifest.variables['enableBrowser'] !== '1') {
@@ -319,6 +320,11 @@ var ProvidersFacebookSdk = (function () {
319
320
  }
320
321
  snippet();
321
322
  runInit(manifest.variables['pixelId'], manifest.variables['ldu'] === '1', userId);
323
+ if (((_a = consentData === null || consentData === void 0 ? void 0 : consentData.consent) === null || _a === void 0 ? void 0 : _a.facebook) || (consentData === null || consentData === void 0 ? void 0 : consentData.categories.advertising)) {
324
+ if (window.clientParamsHelper) {
325
+ window.clientParamsHelper.collectAndSetParams(true);
326
+ }
327
+ }
322
328
  };
323
329
 
324
330
  const getProductIdFromMapping = (item, productIdMapping) => {
@@ -405,7 +411,7 @@ var ProvidersFacebookSdk = (function () {
405
411
  };
406
412
  const tag = ({ data, eventName, manifestVariables, eventId }) => {
407
413
  const payload = {
408
- sdkVersion: "1.28.1" ,
414
+ sdkVersion: "1.30.0" ,
409
415
  };
410
416
  if (window.fbq &&
411
417
  !!manifestVariables['pixelId'] &&
package/index.mjs CHANGED
@@ -308,7 +308,8 @@ const snippet = () => {
308
308
  script.parentNode.insertBefore(element, script);
309
309
  }
310
310
  };
311
- const init = ({ manifest, userId }) => {
311
+ const init = ({ manifest, userId, consentData }) => {
312
+ var _a;
312
313
  if (!manifest.variables ||
313
314
  !manifest.variables['pixelId'] ||
314
315
  manifest.variables['enableBrowser'] !== '1') {
@@ -316,6 +317,11 @@ const init = ({ manifest, userId }) => {
316
317
  }
317
318
  snippet();
318
319
  runInit(manifest.variables['pixelId'], manifest.variables['ldu'] === '1', userId);
320
+ if (((_a = consentData === null || consentData === void 0 ? void 0 : consentData.consent) === null || _a === void 0 ? void 0 : _a.facebook) || (consentData === null || consentData === void 0 ? void 0 : consentData.categories.advertising)) {
321
+ if (window.clientParamsHelper) {
322
+ window.clientParamsHelper.collectAndSetParams(true);
323
+ }
324
+ }
319
325
  };
320
326
 
321
327
  const getProductIdFromMapping = (item, productIdMapping) => {
@@ -402,7 +408,7 @@ const prepareData = (data, productIdMapping) => {
402
408
  };
403
409
  const tag = ({ data, eventName, manifestVariables, eventId }) => {
404
410
  const payload = {
405
- sdkVersion: "1.28.1" ,
411
+ sdkVersion: "1.30.0" ,
406
412
  };
407
413
  if (window.fbq &&
408
414
  !!manifestVariables['pixelId'] &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-facebook-sdk",
3
- "version": "1.28.1",
3
+ "version": "1.30.0",
4
4
  "description": "Facebook Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",