Skip to content

Commit e595ef5

Browse files
committed
Fix createdTs handling
1 parent 68b231b commit e595ef5

File tree

1 file changed

+2
-1
lines changed
  • plugins/browser-plugin-element-tracking/src

1 file changed

+2
-1
lines changed

Diff for: plugins/browser-plugin-element-tracking/src/api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export function SnowplowElementTrackingPlugin({ ignoreNextPageView = true } = {}
132132
}
133133
},
134134
beforeTrack(payload) {
135+
// attach stat/component entities for configured events
135136
const e = payload.getPayload()['e'];
136137
let eventName: string;
137138

@@ -457,7 +458,7 @@ function handleCreate(nowTs: number, config: Configuration, node: Node | Element
457458
* On the other hand, if a CREATE was determined, start observing intersections if that's requested in the configuration.
458459
*/
459460
function mutationCallback(mutations: MutationRecord[]): void {
460-
const nowTs = performance.now() - performance.timeOrigin;
461+
const nowTs = performance.now() + performance.timeOrigin;
461462
mutations.forEach((record) => {
462463
configurations.forEach((config) => {
463464
const createFn = handleCreate.bind(null, nowTs, config);

0 commit comments

Comments
 (0)