Google Tag Manager

Forum Discussion

deltamayhak's avatar
deltamayhak
Active Member
2 years ago

How to merge an email-only user with a user alias through the API

I want to merge 2 users via the merge API endpoint but am concerned it's not actually possible. Do you know how to solve this problem?

Situation: (all for a user who does not have an external id)

  1. an email-only user is created via the Track endpoint through website
  2. later a data sync from the warehouse adds more information about the user but can only send the data using the user alias path.
  3. I now have one email-only user and another identified as a duplicate due to sharing email that's a user alias
  4. I cannot merge them ... I've pasted what I'm trying to send in the Merge call. I think the issue is when using "email" as identifier it's unable to find the email-only user and keeps prioritizing the user alias thus nothing happens. I know I can add in the "most_recently_updated" item but that doesn't work in this case. Ideally there'd be a way to specifically say email-only as the identifier_to_merge and not include user alias or identified user that share the email.
{
  "merge_updates": [
    {
      "identifier_to_keep": {
        "user_alias": {
          "alias_name": "{{ user_email }}",
          "alias_label": "email"
        }
      },
      "identifier_to_merge": {
        "email": "{{ user_email }}",
        "prioritization": [
          "unidentified"
        ]
      }
    }
  ]
}

I can merge the 2 in the Braze Admin UI but that looks to be using functionality not exposed via API to Braze customers and uses the Braze ID which I don't want to mimic that.



No RepliesBe the first to reply