Skip to content

Commit cb69fc1

Browse files
committed
Update client-conversion-tracking.js
1 parent 2979be6 commit cb69fc1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/script/src/extensions/client-conversion-tracking.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,20 @@ const initClientConversionTracking = () => {
6767
const queueManager = window._dubAnalytics.qm;
6868
const existingQueue = queueManager.queue || [];
6969

70-
existingQueue.forEach(([method, ...args]) => {
70+
const remainingQueue = existingQueue.filter(([method, ...args]) => {
7171
if (method === 'trackLead') {
7272
trackLead(...args);
73+
return false;
7374
} else if (method === 'trackSale') {
7475
trackSale(...args);
76+
return false;
7577
}
78+
79+
return true;
7680
});
81+
82+
// Update the queue with remaining items
83+
queueManager.queue = remainingQueue;
7784
}
7885
};
7986

0 commit comments

Comments
 (0)