Skip to main content

I have a question about amplitude and the background is: Due to some dev issue, we posted wrong user_id for some session. For example, user ‘abc’ have 10 events, but we posted 5 events to user:‘abc’ and another 5 events to user:‘abcc’.Now I want to merge the 10 events together to user ‘abc’. I know that merging user is not allowed in Amplitude. So I think that the only way to do is to find which 5 events are sent to ‘abcc’ and resent them to ‘abc’. In the same time, I will delete user:’abcc’ to remove the redundant data.

The hardest part is to find which events are sent to ‘abcc’ in my database, so I’m wondering if I can download all events of ‘abcc’ in amplitude and send them to ‘abc’.

 

My solution to my problem may not be the best way. if you have better solutions can also tell me.

Hi @haoyuan 

To identify events sent by a given user id, you can use a chart like this - https://analytics.amplitude.com/demo/chart/new/7f16iyc. This will give you the name of events triggered for a given user id.

If you are looking for the raw details of these events, then searching the users event stream via user lookup and examining those 5 events will help.

Hope this helps.


Hi @Saish Redkar 
 

Thanks for your help. Actually, I have about 100 users with wrong user_id and thousands of events are sent to these users so I can’t do this by looking which events are sent to these users in  users event stream via user lookup. What I need is to download all events of the 100 users and search these events to my database and resend them to the correct user_id.


Hi @haoyuan 

If you have access to cohorts feature, you can list those 100 user ids in a csv and import a cohort from a file. Or you can just create a user segment filtered on those user ids.
Once you have this, you can apply this cohort to the above chart by removing the user id filter and just grouping by user id, event name. However this will give you the listing of just the user id and the triggered event name by those users ids. There is no direct chart functionality to get the event name along with event property level data without doing individual property group bys.

To get a complete user id <> event level context, you might have to export your event data via Export API or export to desired destinations to get the row level context of each of those events and then select those against those 100 matching ids.

Let me know if I’m interpreting your use case correctly.


Hi @haoyuan and welcome to the community! 👋 If you would like to export all of a single user's raw data, I recommend using the DSAR API instead: https://www.docs.developers.amplitude.com/analytics/apis/ccpa-dsar-api/?h= 
 
Once you have the user's data exported, you can then edit the user ID listed on the raw event data and use HTTP API or Batch API to upload those events to the right users. 

 

Let me know if this helps along with what @Saish Redkar recommended. 😊


Hi @Esther Trapadoux , I tried to use the DSAR API but it need org-api-key which I don’t know. I sent a ticket to get the api key but no one replied to me till now. It has been three days. Do you know how to get my org-api-key immediately?

 


@haoyuan thanks for the nudge, I found your ticket and gave the team a nudge. Just want to confirm, are you the admin on the account? If not, they’ll likely request an admin on the account make this request so the org api key can be shared with them.


@Esther Trapadoux Yes I’m an admin.


@haoyuan perfect, I’ve let the team know. Thank you!


@haoyuan just wanted to follow up here. The team got back to you on Friday, May 12th. Did you see the key come through in your email?

 


@Esther Trapadoux Yes I see that. Thank you so much.


Reply