@blotoutio/providers-facebook-sdk 0.9.4 → 0.10.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.
- package/index.js +14 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -69,9 +69,6 @@ var ProvidersFacebookSdk = (function () {
|
|
|
69
69
|
if (data['status']) {
|
|
70
70
|
payload['status'] = data['status'];
|
|
71
71
|
}
|
|
72
|
-
if (data['num_items']) {
|
|
73
|
-
payload['num_items'] = data['num_items'];
|
|
74
|
-
}
|
|
75
72
|
if (data['predicted_ltv']) {
|
|
76
73
|
payload['predicted_ltv'] = data['predicted_ltv'];
|
|
77
74
|
}
|
|
@@ -101,15 +98,24 @@ var ProvidersFacebookSdk = (function () {
|
|
|
101
98
|
return content;
|
|
102
99
|
});
|
|
103
100
|
}
|
|
101
|
+
if (data['contents'] || data['ids']) {
|
|
102
|
+
const contents = data['contents'] || data['ids'];
|
|
103
|
+
if (Array.isArray(contents)) {
|
|
104
|
+
payload['num_items'] = contents.length;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
104
107
|
return payload;
|
|
105
108
|
};
|
|
106
109
|
const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
const payload = {
|
|
111
|
+
sdkVersion: "0.10.1" ,
|
|
112
|
+
};
|
|
113
|
+
if (window.fbq && manifestVariables['enableBrowser'] === '1') {
|
|
114
|
+
window.fbq('track', eventName, prepareData(data, manifestVariables['variantId'] === '1'), {
|
|
115
|
+
eventID: eventId,
|
|
116
|
+
});
|
|
109
117
|
}
|
|
110
|
-
|
|
111
|
-
eventID: eventId,
|
|
112
|
-
});
|
|
118
|
+
return payload;
|
|
113
119
|
};
|
|
114
120
|
|
|
115
121
|
const data = {
|