Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce tracker size by using navigator.sendBeacon #1730

Closed
wants to merge 2 commits into from
Closed

Reduce tracker size by using navigator.sendBeacon #1730

wants to merge 2 commits into from

Conversation

willfarrell
Copy link

Changes

Replace XMLHttpRequest for navigator.sendBeacon. Also adds in the ability to allow events to be triggered on page exit.

This will likely need an update to the back end (sorry, don't know elixir) to change what headers are used (ie use ping-from over Referer maybe?). Not sure what others header are send along with the request that maybe be used by plausible. Some testing will be needed.

It's intended to be used for sending analytics data to a web server, and avoids some of the problems with legacy techniques for sending analytics, such as the use of XMLHttpRequest. ~ MDN

Below you'll find a checklist. For each item on the list, check one option and delete the other.

Tests

  • This PR does not require tests

Changelog

  • Entry has been added to changelog

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

drop XMLHttpRequest  for navigator.sendBeacon
@willfarrell willfarrell changed the title Reduce tracter size Reduce tracker size by using navigator.sendBeacon Mar 2, 2022
@ukutaht
Copy link
Contributor

ukutaht commented Mar 3, 2022

Hi @willfarrell, thanks for the PR!

I think you already read the discussions we've had about this. I think currently Beacon is not well-supported enough to make it the default way of sending pageviews. We have talked about and might incorporate beacon as an optional extra in the future. But we definitely won't use it as the default anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants