user-agents icon indicating copy to clipboard operation
user-agents copied to clipboard

Feat env injection

Open HugoPoi opened this issue 4 years ago • 4 comments

  • 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

HugoPoi avatar Nov 24 '20 15:11 HugoPoi

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.

sangaline avatar Feb 12 '21 19:02 sangaline

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.

HugoPoi avatar Feb 14 '21 16:02 HugoPoi

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?

sangaline avatar Feb 15 '21 15:02 sangaline

Seems good to me for this one.

HugoPoi avatar Feb 19 '21 21:02 HugoPoi