mitkins

mitkins

Analytics Service for Live View

I’ve been thinking about analytics with my own website lately. Originally I started out with Google Analytics. The thing I liked the most about this was checking out referrals and looking at the map to see what part of the world the traffic is coming from.

But then I listened to this episode of the Changelog:

It covered a number of topics. Some points that resonated with me:

  • Google Analytics is not lightweight
  • Privacy/tracking issues
  • Cookie-less option

Some time later, I read this post from Jose:

This was before fly.io. Setting up my own Plausible server for a side project seemed fun, but not something I want to maintain (and ultimately would add cost). So, I decided to rip out Google Analytics and just stick with my users table - which records the user’s timezone (based on the user’s IP address).

For me, this has been enough. However, I recently came across https://splitbee.io. For a low traffic website such as mine, this gives me a nice UI to inspect similar (yet probably more accurate) information. I also really enjoyed the onboarding process.

So I started thinking about analytics again - this time from a technology/product point of view (i.e. not making a personal decision based on cost).

This is a naïve thought - but could you make an analytics solution that is designed to work exclusively with Live View? I’m assuming through the Live View life cycle that a javascript call is being made per page render to the Phoenix server anyway. So could you piggy-back on that to achieve similar functionality to a traditional javascript Page Tagging solution (such as Google Analytics).

Specifically, I was thinking you could create a pub-sub communication model between the web application and the analytics service. The thought of an Elixir-centric solution in my web app is appealing and this feels like it carries on the spirit of Live View - i.e. there is javascript but you don’t have to think about it. I like the onboarding experience with Splitbee too - I could see a similar experience, but with an Elixir-based product. I’m not sure if there would be any other benefits to such a solution (above and beyond a traditional javascript solution) or even this is a good idea! Just thought I’d see what other people think.

Finally, and this is a self-serving question, is this something that people would be interested in? The existing solutions out there are already fantastic! Would you pay for such a thing?

Most Liked

kevinlang

kevinlang

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.

mitkins

mitkins

I like what you’re suggesting. I think it fits in very well with the idea of a side-project. All I want is a nice UI to see some simple analytics.

Yeah I think you’re right about the paid product aspect. Onboarding and ease of use is important once you have a potential customer. But I’m not sure that the Live View aspect is enough to justify why you might choose such a service - unless there was some sort of technical advantage/new feature no one has seen before.

Though, maybe you could provide users with their own self-hosted/simple version (to put in their project) and make it easy to transition to a cloud-hosted solution when they see fit…

Where Next?

Popular in Discussions Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
New
AstonJ
If so I (and hopefully others!) might have some tips for you :slight_smile: But first, please say which area you’re finding most challen...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement