Merge-audit documentation


#1

Hi,

I’ve recently been interested in using the merge-audit property returned in the json from batch get contacts method.
Is there some documentation on what contains this method I couldn’t find ?

Thanks,


#2

Hi @matthieu

That property will only be populated if the contact was previously merged with another contact, so you won’t see anything in most cases. There’s an example of what could be there below.

"merge-audits": [
  {
    "canonical-vid": 407546,
    "vid-to-merge": 407596, //this is the old vid from the merged record
    "timestamp": 1459183894522,
    "entity-id": "",
    "user-id": 123456,
    "num-properties-moved": 32,
    "merged_from_email": { //this is the info for the merged record
      "value": "email2@domain.com",
      "source-type": "CONTACTS_WEB",
      "source-id": "user@hubspot.com",
      "source-label": null,
      "source-vids": [
        407596
      ],
      "timestamp": 1459183770094,
      "selected": false
    },
    "merged_to_email": {
      "value": "merge1@domain.com",
      "source-type": "CONTACTS_WEB",
      "source-id": "user@hubspot.com",
      "source-label": null,
      "timestamp": 1459183757761,
      "selected": false
    }
  }
]

#3

Hi @dadams, thanks for your reply.

My goal here is to fetch both email adresses concerned by the merge. Those seem to be accesible with merged_from_email.value and merged_to_email.value, but in some cases :

  • Both are equal, which seem strange to me since email should be a unique identifier. Those all seem to have their entity-id = MIGRATION, but I don’t really see how that’s relevant.
  • there is no merged_from_email property, only merged_to_email.

Many thanks for your help,

Matthieu


#4

Do you have an example record that you could link to that I could take a look at? Both of those sound like internal processes but if you can send me an example I can verify that.


#5

Hi @dadams,

As for the first case I pointed out, a relevant JSON (anonymized) would look like :
[
{
“canonical-vid”: 506001,
“timestamp”: 1468021294341,
“entity-id”: “MIGRATION”,
“merged_to_email”: {
“timestamp”: 1467799127483,
“selected”: false,
“source-label”: null,
“value”: “mail_0”,
“source-type”: “MERGE_CONTACTS”,
“source-id”: “”
},
“vid-to-merge”: 2085810,
“num-properties-moved”: 0,
“user-id”: 2147481631
},
{
“canonical-vid”: 506001,
“last-name”: “lastname”,
“timestamp”: 1467799127390,
“entity-id”: “”,
“merged_to_email”: {
“timestamp”: 1461169785276,
“selected”: false,
“source-label”: null,
“value”: “mail_0”,
“source-type”: “ANALYTICS”,
“source-id”: “”
},
“merged_from_email”: {
“timestamp”: 1467518520626,
“selected”: false,
“source-label”: null,
“value”: “mail_0”,
“source-type”: “BATCH_UPDATE”,
“source-id”: “auditId=null”,
“source-vids”: [
2085810
]
},
“vid-to-merge”: 2085810,
“num-properties-moved”: 35,
“first-name”: “firstname”
}
]

As for the second case, it would look like:
[
{
“canonical-vid”: 1839862,
“last-name”: “some_lastname”,
“timestamp”: 1468435566408,
“entity-id”: “MIGRATION”,
“merged_to_email”: {
“timestamp”: 1465896436623,
“selected”: false,
“source-label”: null,
“value”: “some_mail”,
“source-type”: “ANALYTICS”,
“source-id”: “”
},
“vid-to-merge”: 1651451,
“num-properties-moved”: 23,
“user-id”: 2147481631,
“first-name”: “some_firstname”
}
]


#6

Can you send me a link to the contact records or the Hub ID for these records? I’d need to see the full context of the record.


#7

https://app.hubspot.com/contacts/2123903/contact-beta/506001/ for the first
one
https://app.hubspot.com/contacts/2123903/contact-beta/1839862/ for the
second.

Thanks !


#8

Both of those cases look like the merge was caused by the analytics system. The contacts and analytics systems track traffic data for anonymous visitors. Those merges for those two records were cases where that anonymous visitor data was merged with a known contact record, due to some identifying event for the visitor (in these cases it looks like a JavaScript Events API call, but this could also happen by viewing a tracked link from an email).