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

Blog: Reader counter #97

Closed
dominikgeissler opened this issue Mar 4, 2023 · 5 comments · Fixed by #103
Closed

Blog: Reader counter #97

dominikgeissler opened this issue Mar 4, 2023 · 5 comments · Fixed by #103
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed suggestion Maybe this could be the next hit!

Comments

@dominikgeissler
Copy link
Contributor

Suggestion: Add a counter on blog post reflecting the (unique) readers it received

@dominikgeissler dominikgeissler added enhancement New feature or request help wanted Extra attention is needed suggestion Maybe this could be the next hit! labels Mar 4, 2023
@dominikgeissler
Copy link
Contributor Author

is this even possible without cookies (and without doing some shady persistent cookie-esque data storage)?

@janosh
Copy link
Member

janosh commented Apr 9, 2023

You could use plausible to track visitors and ping their stats API to display visitor count.

@dominikgeissler
Copy link
Contributor Author

oh cool, this looks interesting. i'll look into this after #91 is done ^^

dominikgeissler added a commit that referenced this issue May 3, 2023
dominikgeissler added a commit that referenced this issue May 3, 2023
@dominikgeissler
Copy link
Contributor Author

I created a proof of concept on the branch. it works, however we need to include a plausible api key. not sure how we handle client-side keys @janosh

@janosh
Copy link
Member

janosh commented May 3, 2023

You can store secrets in netlify and then inject them using build-time env vars. They have to use the vite-recognized VITE_ prefix to be made available client-side.

dominikgeissler added a commit that referenced this issue May 4, 2023
@dominikgeissler dominikgeissler self-assigned this May 6, 2023
dominikgeissler added a commit that referenced this issue May 12, 2023
* #97 poc

* #97 a bit cleaner

* #97 added plausible api key to .env.example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor to async/await

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Janosh Riebesell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed suggestion Maybe this could be the next hit!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants