@financial-times/o-tracking
Advanced tools
Comparing version 4.1.0 to 4.1.1
{ | ||
"name": "@financial-times/o-tracking", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "Provides tracking for a product. Tracking requests are sent to the Spoor API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,2 +6,3 @@ import Delegate from 'ftdomdelegate'; | ||
import {getTrace} from '../../libs/get-trace.js'; | ||
import { Queue } from '../core/queue.js'; | ||
@@ -76,4 +77,15 @@ let delegate; | ||
delegate.on('click', elementsToTrack, handleClickEvent(eventData), true); | ||
// Fire all click events that were stored in the old queue used by o-tracking v2 | ||
const clickQueue = new Queue('clicks'); | ||
sendAllEventsFromQueue(clickQueue); | ||
}; | ||
function sendAllEventsFromQueue(queue) { | ||
const nextLink = queue.shift(); | ||
if (nextLink) { | ||
core.track(nextLink, () => sendAllEventsFromQueue(queue)); | ||
} | ||
} | ||
const click = { | ||
@@ -80,0 +92,0 @@ init |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
420114
2527