plausible / plausible-tracker

Frontend library to interact with Plausible Analytics
https://github.com/plausible/plausible-tracker
MIT License
215 stars 50 forks source link

Add ability to customize localhost url #62

Open madebyfabian opened 9 months ago

madebyfabian commented 9 months ago

I am running localhost from a custom host (https://myapp.local). The way the localhost detection is currently implemented, the tracker does not recognize if I am on localhost or not, and therefore sends the request.

https://github.com/plausible/plausible-tracker/blob/294405cafc934ee666c1a295a5b2fd8737993ce2/src/lib/request.ts#L40-L43

Possible Implementation

I would suggest to add an option where a user can change their localhost url and therefore making isLocalhost true. Happy to add a PR if you agree.