@blotoutio/edgetag-sdk-browser 0.61.0 → 0.62.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.
Files changed (2) hide show
  1. package/index.js +12 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -485,7 +485,8 @@
485
485
  return Object.fromEntries(cookie
486
486
  .split(/;\s+/)
487
487
  .map((r) => r.split('=').map((str) => str.trim()))
488
- .map(([cookieKey, cookieValue]) => {
488
+ .map(([cookieKey, ...cookieValues]) => {
489
+ const cookieValue = cookieValues.join('=');
489
490
  if (!cookieKey) {
490
491
  return [];
491
492
  }
@@ -561,7 +562,7 @@
561
562
  referrer: getReferrer(destination),
562
563
  search: getSearch(destination),
563
564
  locale: getLocale(),
564
- sdkVersion: "0.61.0" ,
565
+ sdkVersion: "0.62.1" ,
565
566
  ...(payload || {}),
566
567
  };
567
568
  let storage = {};
@@ -615,11 +616,14 @@
615
616
  }
616
617
  return `${destination}${path}`;
617
618
  };
618
- const getTagURL = (destination, options) => {
619
+ const getTagURL = (destination, eventName, options) => {
619
620
  const parsedUrl = new URL(generateUrl(destination, '/tag'));
620
621
  if (options === null || options === void 0 ? void 0 : options.sync) {
621
622
  parsedUrl.searchParams.set('sync', 'true');
622
623
  }
624
+ if (eventName) {
625
+ parsedUrl.searchParams.set('name', eventName);
626
+ }
623
627
  return parsedUrl.toString();
624
628
  };
625
629
  const getInitURL = (destination) => {
@@ -681,7 +685,7 @@
681
685
  if (providers) {
682
686
  payload.providers = providers;
683
687
  }
684
- postRequest(getTagURL(destination, options), payload, options).catch(error);
688
+ postRequest(getTagURL(destination, eventName, options), payload, options).catch(error);
685
689
  };
686
690
  const processTag = (destination, eventName, data = {}, providers, options) => {
687
691
  if (!getSetting(destination, 'initialized')) {
@@ -728,6 +732,7 @@
728
732
  sendTag: sendTag.bind(null, destination),
729
733
  manifestVariables: variable.variableSet,
730
734
  executionContext,
735
+ destination,
731
736
  });
732
737
  }
733
738
  providerData[pkg.name] = result;
@@ -1153,6 +1158,9 @@
1153
1158
  error('Initialization failed');
1154
1159
  return;
1155
1160
  }
1161
+ if (result.isNewUser && result.consent) {
1162
+ saveConsent(preferences.edgeURL, result.consent);
1163
+ }
1156
1164
  const providers = {};
1157
1165
  (_a = result.result) === null || _a === void 0 ? void 0 : _a.forEach((pkg) => {
1158
1166
  const provider = browserPackages[pkg.package];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "0.61.0",
3
+ "version": "0.62.1",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",