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

Customizable endpoint URL and User Language #456

Open
kidonng opened this issue Feb 27, 2022 · 2 comments
Open

Customizable endpoint URL and User Language #456

kidonng opened this issue Feb 27, 2022 · 2 comments

Comments

@kidonng
Copy link
Contributor

kidonng commented Feb 27, 2022

I noticed some parameters are hard-coded, specifically, the Google Analytics endpoint URL (https://www.google-analytics.com/collect) and User Language (ul):

'https://www.google-analytics.com/collect' +
'?v=1' +
'&ul=en-us' +

It would be awesome to be able to:

  • Make ul use actual language provided by the user agent (e.g. navigator.language)
  • Use a custom endpoint URL to avoid people blocking the official endpoint
@jehna
Copy link
Owner

jehna commented Mar 8, 2022

Thank you for opening the issue. Good catch on the ul parameter! This should now be fixeed with #462

Using a custom endpoint would make sense — it would allow for routing the requests from your own domain (getting around any third-party restrictions), and even creating an alternative backends for the ga protocol.

How would you like to pass the endpoint url to ga-lite? How about something like:

galite('create', 'UA-XXXXXXXX-X', 'auto');
galite('set-endpoint', '/my-custom-collect-endpoint');
galite('send', 'pageview');

@nickreese
Copy link

This would be majorly useful. Looking at using this script to proxy traffic through a cloudflare worker.

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

No branches or pull requests

3 participants