@blotoutio/providers-snapchat-sdk 0.20.0 → 0.22.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.
Files changed (2) hide show
  1. package/index.js +47 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -33,6 +33,39 @@ var ProvidersSnapchatSdk = (function () {
33
33
  window.snaptr('init', manifest.variables['pixelId']);
34
34
  };
35
35
 
36
+ const STANDARD_SNAPCHAT_EVENTS = new Set([
37
+ 'PURCHASE',
38
+ 'SAVE',
39
+ 'START_CHECKOUT',
40
+ 'ADD_CART',
41
+ 'VIEW_CONTENT',
42
+ 'ADD_BILLING',
43
+ 'SIGN_UP',
44
+ 'SEARCH',
45
+ 'PAGE_VIEW',
46
+ 'SUBSCRIBE',
47
+ 'AD_CLICK',
48
+ 'AD_VIEW',
49
+ 'COMPLETE_TUTORIAL',
50
+ 'LEVEL_COMPLETE',
51
+ 'INVITE',
52
+ 'LOGIN',
53
+ 'SHARE',
54
+ 'RESERVE',
55
+ 'ACHIEVEMENT_UNLOCKED',
56
+ 'ADD_TO_WISHLIST',
57
+ 'SPENT_CREDITS',
58
+ 'RATE',
59
+ 'START_TRIAL',
60
+ 'LIST_VIEW',
61
+ 'APP_INSTALL',
62
+ 'APP_OPEN',
63
+ 'CUSTOM_EVENT_1',
64
+ 'CUSTOM_EVENT_2',
65
+ 'CUSTOM_EVENT_3',
66
+ 'CUSTOM_EVENT_4',
67
+ 'CUSTOM_EVENT_5',
68
+ ]);
36
69
  const prepareData = (data) => {
37
70
  const payload = {};
38
71
  if (data['currency']) {
@@ -131,10 +164,21 @@ var ProvidersSnapchatSdk = (function () {
131
164
  };
132
165
  const tag = ({ data, eventName, manifestVariables, eventId }) => {
133
166
  if (window.snaptr && manifestVariables['enableBrowser'] === '1') {
134
- window.snaptr('track', getSnapEventName(eventName), Object.assign(Object.assign({}, prepareData(data)), { client_dedup_id: eventId.toString(), integration: 'blotout' }));
167
+ const event = data['skipTransformation'] === true
168
+ ? eventName
169
+ : getSnapEventName(eventName);
170
+ const eventData = data['skipTransformation'] === true ? data : prepareData(data);
171
+ delete eventData['skipTransformation'];
172
+ if (STANDARD_SNAPCHAT_EVENTS.has(event)) {
173
+ window.snaptr('track', event, {
174
+ ...eventData,
175
+ client_dedup_id: eventId.toString(),
176
+ integration: 'blotout',
177
+ });
178
+ }
135
179
  }
136
180
  return {
137
- sdkVersion: "0.20.0" ,
181
+ sdkVersion: "0.22.0" ,
138
182
  };
139
183
  };
140
184
 
@@ -151,7 +195,7 @@ var ProvidersSnapchatSdk = (function () {
151
195
  window.edgetagProviders.push(data);
152
196
  }
153
197
  }
154
- catch (_a) {
198
+ catch {
155
199
  // No window
156
200
  }
157
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-snapchat-sdk",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Snapchat Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",