Solved

(Ab)using identify()

  • 29 March 2023
  • 1 reply
  • 99 views

Userlevel 2
Badge

Hi, I’d really like to hear community thoughts about the following. We’re implementing Amplitude through Segment in a SPA and we ran into an interesting question

We want every event that arrives to amplitude to have a property `product_capability` where the value describes the part of the product where the event fired from. In other words if a user navigates to the homepage and clicks on a button A and then on a button B there there we would capture this:

homepage viewed {product_capability:home}

button_a clicked {product_capability:home}

button_b clicked {product_capability:home}

 

if they then navigated to whatever page and clicked on 2 buttons there we would do this
 

whatever_page viewed {product_capability:whatever}

button_a clicked {product_capability:whatever}

button_b clicked {product_capability:whatever}

 

As you can see we’re adding product_capability as an event property to every event.

 

What would happen if we add that property as a user trait and then called identify() every time it changes. Implicitly amplitude events would have the correct product_capability value as long as the identify call arrives to amplitude before all other event calls 

This way we’d only add product_capability to our identify call and not all track() and page() call

 

This feels a weird approach because those are not user traits, however the way Amplitude associates implicitly user traits to events this could work.

I’d really like to hear, what are the pros and cons of this approach?

 

Thank you very much
 

icon

Best answer by Jeremie Gluckman 4 April 2023, 01:33

View original

1 reply

Userlevel 6
Badge +9

Thanks for posting here @luigi7up and excuse the delay. Here’s where you can find more info about our identify API link.

Some advantages include: 

  • You could reduce the data sent with each event every time it changes.
  • You could segment your data by this property in Amplitude more efficiently and create customer cohorts based on the product capability they used when they performed specific actions, which could help you better understand user behavior.

Some disadvantages include the following: 

  • Added complexity.
  • Multiple users may use the same account or device ID, as values could get overwritten.

I hope this helps! 

Reply