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

location is not defined #56

Open
pixelpaulaus opened this issue Sep 26, 2023 · 1 comment
Open

location is not defined #56

pixelpaulaus opened this issue Sep 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pixelpaulaus
Copy link

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

@pixelpaulaus pixelpaulaus added the bug Something isn't working label Sep 26, 2023
@Daniel15
Copy link

Daniel15 commented Oct 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants