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

laiboonh
Hi all, I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
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
scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement