excellalabs/xluhco

Specify beacon tracking for gtag.js?

Opened this issue · 0 comments

Sometimes with html or image, the hits to GA won't be sent if the page is unloading (which we try to do asap).

However, beacons have been implemented by many browsers, and we can instruct Google Analytics to use them.

https://developers.google.com/analytics/devguides/collection/gtagjs/sending-hits#specify_different_transport_mechanisms

Since we're redirecting on the callback already, this could also potentially improve performance. Not sure. Need to look into it a little bit more.