@blotoutio/providers-pinterest-sdk 0.31.0 → 0.32.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
@@ -143,7 +143,11 @@ const prepareData = (data, idMapping) => {
143
143
  }
144
144
  return payload;
145
145
  };
146
- const tag = ({ data, eventName, manifestVariables, eventId }) => {
146
+ const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
147
+ const result = { sdkVersion: "0.32.0" };
148
+ if (executionContext.get('pixelFired')) {
149
+ return result;
150
+ }
147
151
  if (window.pintrk && manifestVariables['pixelId']) {
148
152
  const name = data['skipTransformation']
149
153
  ? eventName
@@ -152,14 +156,13 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
152
156
  ? data
153
157
  : prepareData(data, manifestVariables['productIdMapping']);
154
158
  delete eventData['skipTransformation'];
159
+ executionContext.set('pixelFired', true);
155
160
  window.pintrk('track', name, {
156
161
  ...eventData,
157
162
  event_id: eventId.toString(),
158
163
  });
159
164
  }
160
- return {
161
- sdkVersion: "0.31.0" ,
162
- };
165
+ return result;
163
166
  };
164
167
 
165
168
  // eslint-disable-next-line @nx/enforce-module-boundaries
package/index.js CHANGED
@@ -144,7 +144,11 @@ var ProvidersPinterestSdk = (function () {
144
144
  }
145
145
  return payload;
146
146
  };
147
- const tag = ({ data, eventName, manifestVariables, eventId }) => {
147
+ const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
148
+ const result = { sdkVersion: "0.32.0" };
149
+ if (executionContext.get('pixelFired')) {
150
+ return result;
151
+ }
148
152
  if (window.pintrk && manifestVariables['pixelId']) {
149
153
  const name = data['skipTransformation']
150
154
  ? eventName
@@ -153,14 +157,13 @@ var ProvidersPinterestSdk = (function () {
153
157
  ? data
154
158
  : prepareData(data, manifestVariables['productIdMapping']);
155
159
  delete eventData['skipTransformation'];
160
+ executionContext.set('pixelFired', true);
156
161
  window.pintrk('track', name, {
157
162
  ...eventData,
158
163
  event_id: eventId.toString(),
159
164
  });
160
165
  }
161
- return {
162
- sdkVersion: "0.31.0" ,
163
- };
166
+ return result;
164
167
  };
165
168
 
166
169
  // eslint-disable-next-line @nx/enforce-module-boundaries
package/index.mjs CHANGED
@@ -141,7 +141,11 @@ const prepareData = (data, idMapping) => {
141
141
  }
142
142
  return payload;
143
143
  };
144
- const tag = ({ data, eventName, manifestVariables, eventId }) => {
144
+ const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
145
+ const result = { sdkVersion: "0.32.0" };
146
+ if (executionContext.get('pixelFired')) {
147
+ return result;
148
+ }
145
149
  if (window.pintrk && manifestVariables['pixelId']) {
146
150
  const name = data['skipTransformation']
147
151
  ? eventName
@@ -150,14 +154,13 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
150
154
  ? data
151
155
  : prepareData(data, manifestVariables['productIdMapping']);
152
156
  delete eventData['skipTransformation'];
157
+ executionContext.set('pixelFired', true);
153
158
  window.pintrk('track', name, {
154
159
  ...eventData,
155
160
  event_id: eventId.toString(),
156
161
  });
157
162
  }
158
- return {
159
- sdkVersion: "0.31.0" ,
160
- };
163
+ return result;
161
164
  };
162
165
 
163
166
  // eslint-disable-next-line @nx/enforce-module-boundaries
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-pinterest-sdk",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Pinterest Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",