Analytics Service for Live View

I’ve been thinking about making something similar to this. Essentially it would be similar to the ahoy gems in Rails, but fully GDPR out of the box, and focused entirely on marketing analytics (views not associated with any given user).

One would add the package, then generate the required migration files to run, which would add two tables “visits” and “sessions”. Then one would need to wire up the LiveView mount lifecycle to send an event to the application that would be in charge of computing a hash of salt + ip + user_agent and storing the visit in the table (similar to plausible.io).

For viewing the dashboard, the package would also have a Live Dashboard plugin that would show the basic stats that most people care about.

It seems like it would be quite useful. My motivation for the above idea is to provide a turn-key solution that covers what most simple Phoenix sites would need without needing to sign up for external services which are not needed if one already has a perfectly functioning (Postgres) database.

With regards to your larger question as to whether the LiveView aspect of things and a better integration with Elixir constitutes a better paid product, I’m not so sure. Most analytics services provide an event API which one could send events to as an alternative to their default JS script you would otherwise include.

4 Likes