navigator.sendBeacon

AnduCrandu 24-08-2017

Will Adobe Analytics ever use navigator.sendBeacon() to help send tracking calls before page unload more consistently?

For browsers that support it, of course

Navigator.sendBeacon() - Web APIs | MDN

11 Comments (11 New)
11 Comments
ltaparia 16-07-2019

ursboller​ Can you please help me to get this done? I want to send image beacon to Omniture when a user is intending to close his web page.

ursboller
MVP
16-07-2019

can't do a lot, just hoping for a lot of votes myself  

ltaparia 16-07-2019

Sure, I will upvote once you help me with a solution 🙂

ursboller
MVP
16-07-2019

don't have a solution (yet). best would be to have an official function to use. or maybe someone writes an Launch extension for that?

justin_grover
Employee
22-07-2019

Thanks for the feedback. We will continue to look at this. Browser support is such that this makes a lot of sense now.

justin_grover
Employee
19-08-2019

Good news. The latest version of AppMeasurement will use sendBeacon for ExitLinks.

Release Notes - AppMeasurement for JavaScript

There are some oddities with sendBeacon that make it tricky to use more often (e.g. Size limits per session, Number of requests active at a single time and such).

ursboller
MVP
19-08-2019

does that mean a change in how the "exitlink" tracking works? do we need to pay attention in our current implementation (especially how much data we add to the exitlink tracking beacon)?

ltaparia 19-08-2019

Thanks justin_grover​ for the update.  Can you please let me know, how reporting side is impacted with this? When I was quering about this, my objetive was to identify visitors(for retargeting) as soon as they leave our site irerespective of session status?

justin_grover
Employee
04-09-2019

@ursboller and @itaparia You shouldn't need to pay any special attention to exit links other than what you are currently doing. The limit is most browsers enforce is that you can only have 64k of stuff queued in sendBeacon (See the spec). This is usually not a problem for most exit links but can become a problem for other tracking scenarios (especially in offline mode of a PWA). With our new implementation the only effects should be exit links should unload slightly faster and the data transmission is slightly more reliable.

charism51522941 16-09-2019

Thanks Justin for the update.

Is it possible to configure sendBeacon for custom link server calls? There are cases (i.e. CTA links which transition visitors to pages under the same domain) that sendBeacon would be useful in order not to miss traffic. I know that we can use navigator.sendBeacon but this requires to generate the URL and data of the server call before calling it. Is there any function in the AppMeasurement JS object which can do this?

The AppMeasurement object also has a property called useBeacon (s.useBeacon) which is set to 0. Do we need to apply any configuration on the value to enable sendBeacon for exit Links?