Solved

What's the best practice?


Userlevel 2
Badge

Hi, I’m looking for help on setting up a new Amplitude project (through Segment) and I would like to run some of the ideas we have with you.

 

CONTEXT

We have 3 different web projects that are feeding into the same Amplitude project: A) Web app (Single page application). B) Docs pages and our C) Public website

Events coming from B and C are sometimes (usually) coming from the anonymous users until they sign up or login and then we identify them.

There are many teams involved in the development (especially on the A) and up until now they had a lot of freedom instrumenting their events the way they felt like/needed. That gave us a lot of speed and agility, but it also produced the following problems:

  1. 3000+ different events
  2. 2000+ different properties
  3. Sending events with little semantic meaning
  4. No descriptions of the events
  5. Sending events that should be properties (AB test shown OR DarkMode is on...)
  6. Sending 12-15 events just when the app loads (render of the main wrapper, render of the sidebar, render of the top notification etc.)
  7. Since we are firing at least 6-7 events on every navigational change and sometimes no VIEW event, we are unable to use pathfinder to discover the navigational patterns of our users among other issues

We want to tackle all those problems by:

  1. Reducing the number of events by firing only one event when the app is rendered, when a user navigates to a certain section etc.
  2. Reducing the number of events by moving a lot of the meaning to the properties. For example, if a user can add another teammate from 3 different sections we might have if as one single event with a property section that tells us where this button got clicked
  3. Changing the naming convention and introducing mandatory properties in the events
  4. Impose schema and strict taxonomy (through Govern plugin and Segment’s capabilities)

WHAT WE WANT TO BE ABLE TO DO

All events would have the following format: (action) semantical meaning. Here are some examples:

(click) submit-payment-details

(hover) search-bar

(validation) submit-payment-details-form

(response) submit-payment-details-form

(view) homepage

(view) pricing

(view) management/users

(view) management/account-settings

 

You will notice a few things:

  1. (click), (view)… is there to impose some strict structure that our safeguard regex can check and reject any events that don’t start with WHAT happened
  2. (view) can help us easily distinguish the pure navigational events and easily analyse users navigational habits. For example, it allows us to use pathfinder by including only events that include “(view)” in their names. Yes, we could also have a property action_type: that would tell us if an event is navigational or not, but as far as I know in the pathfinder you cannot include/exclude events using properties’ values
  3. We are not stating WHERE an event occurred (homepage_add-new-member, settings_users_add-new-member, my-profile_add-new-member ), but we go with a simple add-new-member and then in the mandatory property section we detail the section of the event like this:  add-new-member {section:”app/homepage”}, add-new-member {section:”app/my-profile”}, add-new-member {section:”app/settings-user”}. With this approach we want to be able to see our critical events as one goal no matter where it occurs and also be able to analyse our critical funnels more easily, buy asking the questions like this one: “How many users did add a new teammate on the same day they created an account?”. With the approach we’re having one wouldn’t have to know all places where someone can click on the button that we consider a goal. 
  4. We’re using the “/” to indicate if something is nested within something else. This is for reading purposes because as I said before all our events will have the section and path properties where this information will be held

 

 

Here’s an example of how our events might look like: 

 

(view) app/home
{
    section: app/home
    path: www.domain.com/app/something
    user_id: xxx
}


(click) main-menu
{
    section: app/home
    path: www.domain.com/app/something
    menu-item: "settings" //what got clicked
    user_id: xxx
}

(view) app/settings
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}

(click) add-new-user
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}


/****

OR MAYBE WITH NESTING (notice settings/ in the event name)?

(click) settings/add-new-user
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}
*/

 

(click) add-new-user
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}

(hover) info-adding-users
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}

/***

OR MAYBE WITH NESTING (notice settings/ in the event name)?
-------------
(hover) settings/info-adding-users
{
    section: app/settings
    path: www.domain.com/app/settings-path
    user_id: xxx
}
*/


Questions

I’d really appreciate any help and would like to hear your opinion on this approach and what problems we might run into by doing it like this?

 

Should we add more information on the context in the event name or we should keep it lean and put all the context in the properties. The former will generate more events and will require to instrument a new one even if we simply move a button or a form from one place to another while the latter will stay clean and simple, but it might give us problems in the funnel analysis since we’d have to go through the properties values etc.

 

Also, is there a better way to differentiate the navigational events from the user actions events to be able to analyse funnels, paths etc more easily?

 

Thank you so much for taking time!

Best regards

Luka


 

icon

Best answer by belinda.chiu 17 May 2022, 22:26

View original

2 replies

Userlevel 6
Badge +9

Thanks for reaching out here @luigi7up. I ran a quick search and found these community threads with segment best practices that might help. Please keep me posted as you make progress and if you find anything else. 

 

Userlevel 6
Badge +8

Hi @luigi7up! Happy to help :)

I will preface this in that the taxonomy of your events will really depend on what your organization decides. I can provide some thoughts/opinions but it’ll be hard to say one way is right vs the other. That said Amplitude always champions having good clean data and we mean that in the following which might help as guidelines: 

  1. Only tracking events that is critical and important to your analyses - hence a 2000 event type limit 
  2. Making sure there is a standardized syntax across all of your events 

So the items that you listed under the “We want to tackle all those problems by” is definitely a great plan and we 100% support that! 

It might be helpful to take a look at our Data Taxonomy Playbook for some recommendations: https://help.amplitude.com/hc/en-us/articles/115000465251-Data-taxonomy-playbook-part-one-Getting-started

Regarding to your specific approach, you are definitely on the right track and already have the considerations in place between putting more context in the event name or keeping it lean and context in event properties. 

Now for my opinion, I have generally seen it more organized to keep the event type list lean and put context in event properties. While this may require a bit more time to set-up charts because you will have to go through property values, this does prevent having to generate more events each time the event changes and also keep your event types under the 2000 limit. To combat the easy-of-use piece, usually what I have seen Admins done is create Custom Events that already has the event set up with the right property filters (so that their employees know which events to use) or have an internal documentation that would teach their employees or be used as reference.

Again, if you do foresee your colleagues having problems with being able to build analyses, then maybe it might be worth considering the context in event names approach. Otherwise from a governance perspective, context in event properties would be more preferred. 

Let me know if you have any questions! 

Reply