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

Install via NPM #46

Open
sandstrom opened this issue Sep 23, 2024 · 3 comments
Open

Install via NPM #46

sandstrom opened this issue Sep 23, 2024 · 3 comments

Comments

@sandstrom
Copy link

Would be nice with instructions on how to install this via NPM, to avoid having to make an HTTP request to pull the file for every page load (i.e. /latest.js).

This will also help with Adblockers, since the code is instead bundled inside the static HTML/CSS/JS for the website.

Is this possible today? And if so, maybe add some instructions in this repo or in your docs (I've tried to find it, but no luck, but maybe I'm blind 😄)

@adriaandotcom
Copy link
Collaborator

You mean server side?

@sandstrom
Copy link
Author

Depends on what you mean by server-side, but I'm thinking of build-time for popular Single Page Applications (SPAs) such as React, Vue and Static Site Generators such as Astro, Hugo and Gatsby.

For all of them, being able to bundle the simple analytics code among all other JS code (instead of fetching it on every page load) would be a win.

@adriaandotcom
Copy link
Collaborator

Ah, I see. Bundling with the rest of the bundle. It's not on our roadmap, but always happy to accept pull requests.

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

2 participants