Skip to content

A reporting server to collect and visualize web monetization information about a page.

License

Notifications You must be signed in to change notification settings

mralanlee/wm_analytics

Repository files navigation

Web Monetization Analytics

A simple metrics collection of Web Monetization events in relation to tracking page revenue.

The goal of this project is capture web monetization progress events and store them to review at what pages generate the most revenue. Currently, the idea would be to store these metrics in Postgres and to use Grafana to visualize the data. Ideally, in the future, I'd like to be able to have a custom dashboard, which would query the API for the data, and to utilize Redis PubSub to stream the data in real time.

What is Web Monetization?

Web Monetization (WM) is a proposed API standard that allows websites to request a stream of very small payments (e.g. fractions of a cent) from a user.

Here is the web monetization explainer.

Goal of this project

The goal is to showcase the value of web monetization and to attribute or correlate performance of monetization to content. With this in mind, for future potential features or pull request submissions, we will always respect the user's privacy and prohibit the collection of user data.

How This Works (Currently)

A client, the browser, will open a web sockets connection with the metrics server and stream the incoming event.details objects to the server. This is not the most ideal strategy, because it would require a sticky session to a particular service. Other considerations that I've had for this was to use the following:

  • Redis PubSub
  • RabbitMQ
  • gRPC (unfortunately, would also sticky session)

If there is a better approach, please submit a proposal via an issue.

Contributing

Dependencies:

  • Docker
  • Postgres (or available in docker-compose)
  • Grafana (or available in docker-compose)
  • Go (this project was built on 1.15)
  1. Fork the project
  2. Install dependencies:
go mod download
go mod verify
  1. To run the project dependencies:
docker-compose up
  1. To run the mock client to feed/fake monetization data:
docker-compose -p wm_analytics -f docker-compose.yml -f docker-compose.dev.yml up --build -d
  1. Submit PR.

About

A reporting server to collect and visualize web monetization information about a page.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published