Skip to content

Commit e3d2eb2

Browse files
authored
bugfix - analytics prototype - fix customData promise (#225)
1 parent 3875040 commit e3d2eb2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/addons/prototypes/analytics.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ class OptablePrebidAnalytics {
277277
missed,
278278
url: `${window.location.hostname}${window.location.pathname}`,
279279
tenant: this.config.tenant,
280-
sessionDepth: sessionStorage.optableSessionDepth,
281280
// eslint-disable-next-line no-undef
282281
optableWrapperVersion: SDK_WRAPPER_VERSION,
283282
};
@@ -287,11 +286,10 @@ class OptablePrebidAnalytics {
287286
);
288287

289288
if (window.optable.customAnalytics) {
290-
const customData = window.optable.customAnalytics();
291-
if (Object.entries(customData).length) {
292-
this.log(`Adding custom data to payload ${JSON.stringify(customData)}`);
293-
witnessData = { ...witnessData, ...customData };
294-
}
289+
await window.optable.customAnalytics().then((response) => {
290+
this.log(`Adding custom data to payload ${JSON.stringify(response)}`);
291+
Object.assign(witnessData, response);
292+
});
295293
}
296294
await this.sendToWitnessAPI("auction_processed", {
297295
auction: JSON.stringify(witnessData),

0 commit comments

Comments
 (0)