HACKER Q&A
📣 thomasfromcdnjs

How do you name behavioral tracking events when building web apps?


I am curious to hear other thoughts about this subject, everyone knows that naming things is hard™, and I would believe that naming events is just that little more difficult.

Given the problem that when working on a product, you want to track a users journey, actions, intent, failures, outcomes etc for the purpose that anyone in the company be them the CEO, marketer, engineer, customer success, support, can piece together the metrics in any appropriate tool (Segment, Google Analytics, Mixpanel, Intercom etc)

How to name things?!?

(events can obviously have metadata attached, such as the url or component where it happened)

This is just riff-raff in an attempt to be thought provoking;

NOUN_ACTION

USER_CLICKED vs USER_CLICK

HOMEPAGE_USER_REGISTERED vs FORMNAME_USER_REGISTERED

LOGIN_FORM_SUBMITTED or USER_LOGIN

SIGNUP_FORM_FAILED or FAILED_SIGNUP

USER_LOGGED_OUT or LOGGED_OUT

OPENED_DOCUMENT or DOCUMENT_OPENED

EVENT or EVENT_HAPPENED or DID_EVENT_DID_NOT


  👤 jackgolding Accepted Answer ✓
It is always a battle of strict taxonomy vs agility in my experience and in nearly every company I've worked for someone somewhere chose agility. And all it takes is one poorly thought out migration/project to undermine the whole activity of taxonomy. Believe me most large businesses with multi-million dollar investments in digital analytics aren't even doing the most basic campaign tracking correctly, let alone worrying about taxonomy.

I always try to align names with internally used terminology but even a simple thing like "log out" can be complicated for self-service reporting. For example is USER_LOGGED_OUT a dimension (fired on all events), fired by an event listener on a button click or fired after a user-session is cleared by the applet. Are the differences between each platform/operating system?

I don't think theres anything better than good documentation (even within the tag management system) and testing tools like Amplitude's event explorer so that analysts can actually verify what has happened. A few analytics vendors have written about this and segment uses the object-action framework like you've suggested. https://segment.com/academy/collecting-data/naming-conventio...


👤 joegahona
For events I always did NOUN_VERB, but I think the last implementation engineer I worked with said the opposite is also acceptable, as long as you stick with one. Some of your riffing would’ve been impossible in the last analytics tool I used (amplitude), because the context would’ve provided things like “Signup Form” or “Button.” A button was a type of element — Element_Clicked where type = button and name = JOIN (or whatever). Then the page the user was on and the destination URL of the button would inform.