@blotoutio/providers-tiktok-sdk 0.9.3 → 0.10.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.js +10 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -132,19 +132,13 @@ var ProvidersTiktokSdk = (function () {
|
|
|
132
132
|
}
|
|
133
133
|
return event;
|
|
134
134
|
};
|
|
135
|
-
const prepareData = (data
|
|
136
|
-
if (event === 'Search') {
|
|
137
|
-
return data && data['search'] ? { query: data['search'] } : {};
|
|
138
|
-
}
|
|
139
|
-
if (event !== 'AddToCart' &&
|
|
140
|
-
event !== 'ViewContent' &&
|
|
141
|
-
event !== 'PlaceAnOrder' &&
|
|
142
|
-
event !== 'CompletePayment') {
|
|
143
|
-
return {};
|
|
144
|
-
}
|
|
135
|
+
const prepareData = (data) => {
|
|
145
136
|
const payload = {
|
|
146
137
|
app: 'Blotout',
|
|
147
138
|
};
|
|
139
|
+
if (data['search']) {
|
|
140
|
+
payload['query'] = data['search'];
|
|
141
|
+
}
|
|
148
142
|
if (data['value']) {
|
|
149
143
|
payload['value'] = data['value'];
|
|
150
144
|
}
|
|
@@ -213,11 +207,13 @@ var ProvidersTiktokSdk = (function () {
|
|
|
213
207
|
return payload;
|
|
214
208
|
};
|
|
215
209
|
const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
216
|
-
if (
|
|
217
|
-
|
|
210
|
+
if (window.ttq && manifestVariables['enableBrowser'] === '1') {
|
|
211
|
+
const tiktokEventName = getEventName(eventName, manifestVariables);
|
|
212
|
+
window.ttq.instance(manifestVariables['pixelId']).track(tiktokEventName, Object.assign(Object.assign({}, prepareData(data)), { event_id: eventId }));
|
|
218
213
|
}
|
|
219
|
-
|
|
220
|
-
|
|
214
|
+
return {
|
|
215
|
+
sdkVersion: "0.10.0" ,
|
|
216
|
+
};
|
|
221
217
|
};
|
|
222
218
|
|
|
223
219
|
const user = ({ data, manifestVariables }) => {
|