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

Feat env injection #28

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

HugoPoi
Copy link

@HugoPoi HugoPoi commented Nov 24, 2020

  • Add env support see .env.example
  • Add support for multiple google view ids
  • Upgrade babel to 7.x
  • Fix missing uglify deps for webpack build
  • Add some debug trace DEBUG="user-agents:*" npm run update-data

src/index.js Outdated Show resolved Hide resolved
@sangaline
Copy link
Member

Thanks, this is a really nice contribution. For future reference, we have a Contributing Guide and require a Contributor License Agreement (CLA) to be signed before contributions can be merged. I separately implemented a bunch of similar package upgrades and associated fixes today in the course of getting releases working again.

I particularly like the idea of supporting multiple analytics accounts. It would be awesome if we could have a handful of sites gathering the same analytics and then combining data in the releases. I think we should flesh out the logistics around that a bit before merging those changes, but it's a good general direction.

@HugoPoi
Copy link
Author

HugoPoi commented Feb 14, 2021

I have 2 thoughts in mind

  • We might need a method to merge multiple gathered GA data-sets (like incrementally), if we want to use multiple collection points.
  • I want to add a another method of collecting data than depending fully on GA, because for example on my blog I use Matomo. And I don't want to put GA just for collecting user-agents datas.

@sangaline
Copy link
Member

Agreed, I think that contributing data should be as simple as dropping in a single script tag on a site, the script should be open source and auditable, and the script should be as minimal as possible while serving its purpose. Google Analytics was a convenient starting point because 1) it handles data storage and read/write API access in an easy way out of the box, 2) it has some built-in abuse prevention mechanisms that makes it harder to poison data, 3) is GDPR compliant, and 4) it automatically collects some fields and the inference of others (e.g. browser size, device category, screen resolution).

A possible alternative would be to store the data in something like DynamoDB, create a Lambda function to process analytics requests and log them to the database, and then to serve a small script that collects the required fields and reports them to the API endpoint. There's a bit of complexity in getting the infrastructure and CD setup for that, but it would make it much easier to add new fields to the data that's collected and for people to opt-in to contributing data. Any thoughts on that general approach or alternatives?

@HugoPoi
Copy link
Author

HugoPoi commented Feb 19, 2021

Seems good to me for this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants