dojap

dojap

Do you use Google Analytics with Phoenix?

Especially for personal projects where you don’t need to show Google Analytics numbers to your company and stuff, I really think that for tracking users activity, what they click and when etc. Pheonix LiveView is nice.

For example, more and more people are using adblockers, so, the Google Analytics numbers are screwed, which is a non-issue with a server side solution.

But my concern is about performance. Logging every action in the database could be a lot after time and with a lot of users. What is your experience when it comes to performance and logging every action/click/pageload of users, or at least, registered users?

Or should I use some external open source server side solution?

Most Liked

wmnnd

wmnnd

If you don’t have millions of users every month, a naive approach with a regular Postgres or MariaDB instance will probably handle your logs just fine. If you don’t care about permanently persisting these logs, you could also build something using ETS tables.
If you want something more sophisticated built in Elixir, you could give Plausible a try :slight_smile:

edisonywh

edisonywh

Dashbit has some articles on building a homegrown solution - Homemade analytics with Ecto and Elixir - Dashbit Blog, though I just use Plausible (they’re built in Elixir so I’m happy to support!)

c4710n

c4710n

Google Analytics not only can be used from client-side, but also from server-side.

Check out Server-Side Tracking in Google Tag Manager. In this way, you don’t store any action in your database, but the online service, just like using client-side tracking.

Where Next?

Popular in Discussions Top

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 31771 143
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
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
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

Other popular topics Top

New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement