Open pixelpaulaus opened 11 months ago
I don't think this module would work at all in Node.js... It uses a lot of browser APIs, and sends data using XMLHttpRequest which doesn't work in Node either.
For server-side logging, you can instead hit the events API directly: https://plausible.io/docs/events-api
Versions
0.3.8
Describe the bug
"location is not defined" errir given when trying to do server side tracking, as the location object is not there in nodejs, but the module expects it.
Expected behavior
don't make location object a requirement in the environment. I have tried passing my own URL and DOMAIN, but it still calls for the getConfig() function which expects the location.href and location.hostname
Steps to reproduce
so any server side tracking in nodeJS