Contact merging

Import, tracking methods (script), API methods (not including sessions)

When adding a contact using import, tracking method, API methods, the following rules apply:

  • create a contact if it does not exist
  • update a contact if it exists
  • restore a contact from deleted, with history and custom field values preserved, transferred custom fields are overwritten with those transferred in the request, non-transferred ones are not changed, but their values are restored.
  • if a contact's e-mail and phone number are passed and both identifiers are not in the contacts base - create a new contact with e-mail and phone number.
  • if a contact's e-mail and phone number are passed, and there is already a passed e-mail in the contacts base - create a new contact with e-mail and phone number:
    • if mainChannel = email, the phone will be added to the existing contact with email
    • if mainChannel = phone, a new contact will be created with phone only, the e-mail will be retained for the existing contact.
  • if a contact's email and phone are passed, and there is already a passed phone in the contacts base, then:
    • if mainChannel = phone, the email will be added to the existing contact with phone number
    • if mainChannel = email, a new contact will be created with email only, the phone number will be retained for the existing contact.
  • if email and phone of a contact are passed and the contacts base already has both identifiers, but for different contacts, then, depending on the value of mainChannel parameter, the passed main contact fields, custom fields, mailing groups and tags will be assigned to the contact whose identifier is equal to the value of mainChannel.

Pop-Ups

In the case of adding a contact from pop-up mainChannel defaults to email, so the following rules apply:

* create a contact if it does not exist

  • update a contact if it exists
  • restore a contact from the deleted, with history and custom field values preserved, name overwritten with what was transferred from the pop-up, non-transmitted fields are not changed, but their values are restored.
  • if a contact's e-mail and phone number are passed and both identifiers are not in the contacts base - create a new contact with e-mail and phone number.
  • if a contact's e-mail and phone number are passed, and there is already a passed e-mail in the contacts base - create a new contact with e-mail and phone number:
    • if the sessions of the existing and new contact coincide, the phone will be added to the contact with e-mail
    • if the sessions of the existing and new contact do not match, a new contact will be created with the phone only, the e-mail will be saved for the existing contact.
  • if a contact's e-mail and phone number are transferred, and there is already a transferred phone number in the contacts base, then:
    • if the sessions of the existing and new contact match, the e-mail will be added to the contact with the phone number
    • if the sessions of the existing and new contact do not match, a new contact will be created with e-mail only, the phone number will remain with the existing contact.
  • if e-mail, phone number and session are transferred, and the database already has both identifiers but different contacts, the phone number and session will be assigned to the existing contact with e-mail (if the existing contact already had a session and it is different from the new one, the contact will have two sessions).
  • if the e-mail and phone number of a contact are passed, and both identifiers already exist in the contacts base, but for different contacts, the passed main fields of the contact and mailing groups will be assigned to the contact with the e-mail address

Working with session (outside pop-ups)

The following rules apply when working with sessions outside of pop-ups:

  • create a contact if it does not exist
  • update a contact if it exists
  • restore a contact from the deleted, with history and custom field values preserved, name overwritten by what was transferred from the pop-up, non-transferred fields are not changed, but their values are restored.
  • if a contact's e-mail and phone number are passed and both identifiers are not in the contacts base - create a new contact with e-mail and phone number.
  • if a contact's e-mail and phone number are passed, and there is already a passed e-mail in the contacts base - create a new contact with e-mail and phone number:
    • if the sessions of the existing and new contact coincide, the phone will be added to the contact with e-mail
    • if the sessions of the existing and new contact do not match, a new contact will be created with the phone only, the e-mail will be saved for the existing contact.
  • if a contact's e-mail and phone number are transferred, and there is already a transferred phone number in the contacts base, then:
    • if the sessions of the existing and new contact match, the e-mail will be added to the contact with the phone number
    • if the sessions of the existing and new contact do not match, a new contact will be created with e-mail only, the phone number will remain with the existing contact.
Last modified: 2025.09.04 12:28 by Elizaveta Ivannikova