Skip to main content
Solved

Bulk update existing events

  • 21 December 2021
  • 3 replies
  • 526 views

Forum|alt.badge.img

How can I bulk update existing events with a newly created user property?

We created a new user property and would like to set a value for this property for all existing events created before the new property was created. 

More specifically: we’ve had one domain “de” and are expanding to two new domains (fr, nl) so we introduced a new user property “domain” which will be set to the respective domain for each event. For all events created before the new user property was created, the domain value is (naturally) ‘none’ right now. We’d like to change that and set all of them to “de”. 



 

Best answer by MikkoKarvonen

There is no easy way to update existing events. The only approach I can really think of is exporting all your data (https://developers.amplitude.com/docs/export-api), writing a script that updates the user properties, setting up a new Amplitude project, and uploading the event history there by using the HTTP API or Batch API. How feasible this is depends largely on the amount of data you have.

However, depending on the types of queries you are running, this may not be necessary. You could set up a cohort with users that currently have the user property set as ´de´ and use that in your queries. Or even a cohort that makes the assumption that all the users that were using your service before the given date should be treated as having the domain value set as ‘de’, depending on your setup. Combined with saved segments, this might cover your needs surprisingly well.

Also keep in mind that as time moves on, the less relevant this missing bit of data will become, as your coverage will naturally become more and more complete. So it’s always worth considering that can you simply mitigate it until it’s no longer an issue.

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img
  • New Member
  • 1 reply
  • December 21, 2021

Following this because I have a use case for this too!


MikkoKarvonen
Peer Moderator
Forum|alt.badge.img+3
  • Peer Moderator
  • 113 replies
  • Answer
  • December 22, 2021

There is no easy way to update existing events. The only approach I can really think of is exporting all your data (https://developers.amplitude.com/docs/export-api), writing a script that updates the user properties, setting up a new Amplitude project, and uploading the event history there by using the HTTP API or Batch API. How feasible this is depends largely on the amount of data you have.

However, depending on the types of queries you are running, this may not be necessary. You could set up a cohort with users that currently have the user property set as ´de´ and use that in your queries. Or even a cohort that makes the assumption that all the users that were using your service before the given date should be treated as having the domain value set as ‘de’, depending on your setup. Combined with saved segments, this might cover your needs surprisingly well.

Also keep in mind that as time moves on, the less relevant this missing bit of data will become, as your coverage will naturally become more and more complete. So it’s always worth considering that can you simply mitigate it until it’s no longer an issue.


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • December 22, 2021

Thanks for the detailed response and solution suggestions. We will consider both.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings