@blotoutio/providers-tiktok-sdk 0.8.2 → 0.8.4
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 +5 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -122,12 +122,13 @@ var ProvidersTiktokSdk = (function () {
|
|
|
122
122
|
sendIdentityData(manifest.variables, keyName, getEdgeData);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
const getEventName = (event) => {
|
|
125
|
+
const getEventName = (event, manifestVariables) => {
|
|
126
126
|
if (event === 'PageView') {
|
|
127
|
-
return '
|
|
127
|
+
return 'Pageview';
|
|
128
128
|
}
|
|
129
129
|
if (event === 'Purchase') {
|
|
130
|
-
return '
|
|
130
|
+
return ((manifestVariables && manifestVariables['purchaseEvent']) ||
|
|
131
|
+
'PlaceAnOrder');
|
|
131
132
|
}
|
|
132
133
|
return event;
|
|
133
134
|
};
|
|
@@ -209,7 +210,7 @@ var ProvidersTiktokSdk = (function () {
|
|
|
209
210
|
if (!window.ttq || manifestVariables['enableBrowser'] !== '1') {
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
212
|
-
const tiktokEventName = getEventName(eventName);
|
|
213
|
+
const tiktokEventName = getEventName(eventName, manifestVariables);
|
|
213
214
|
window.ttq.instance(manifestVariables['pixelId']).track(tiktokEventName, Object.assign(Object.assign({}, prepareData(data, tiktokEventName)), { event_id: eventId }));
|
|
214
215
|
};
|
|
215
216
|
|