How are image beacons (new Image().src = ‘collectur-url/…’) tested?
A bit more in detail: it’s hard to detect if an image beacon is being processed or it’s done loading because it is not appended anywhere on the page. Right now I only rely on timing of requests, meaning after I track an event using SP tracker I have to wait few hundred milliseconds to start testing against my test cases.
We were thinking about leveraging the localStorage capabilities when the collector is not reachable (and basically events are persisted for later usage) - so we could test against the values of the localStorage, but this is not really testing the actual workflow.
Do you have any suggestions?
You can find the logic for enqueuing the requests (before sending) here.
Hey Mike, thanks for your answer!