Setting a custom field as a tracking code merge key

By default, Ortto associates a session with a known user based on the merge keys (identifiers) provided in the tracking data, in this general order of priority: <primary unique identifier>, <fallback identifier>, email, phone

If you are using push notifications and/or an external identifier, these will be prepended to the merge key priority order, for example: push registration ID, external ID, <primary unique identifier>, <fallback identifier>, email, phone.

NOTE: The primary unique identifier and fallback identifier refer to those set at Settings > Customer data > Unique identifiers (if not set to email and phone, respectively). 

If the above listed merge keys don’t quite suit your needs, you can set a custom field as an additional merge key, such as a customer ID.

To do so, on the tracking code page:

  1. At Allowed custom field as merge key, click Edit.
  2. Click Add field.
  3. Select a relevant existing field or create a new one.
  4. Click Save to finish.



Once added, the custom field merge key is applied immediately. The custom field merge key will be appended to the list of default merge keys, that is: push registration ID, external ID, <primary unique identifier>, <fallback identifier>, email, phone, <custom fields>.

In addition to this article, you may also wish to read about the available merge and find strategies to determine how a person's data sent via the ap3c.track method is ingested.


How to add your custom merge key to the tracking method payload

Once you’ve added a custom merge key to your tracking code data source configuration, you can include it in the payload when you call the ap3c.track method.

To do so, you’ll need to note the following keys:

  • ac – this array is where you specify the custom merge key and value
  • “fi” – is for the custom field, which takes a field ID value (e.g.  “str:cm:customer-id”)
  • “v” – is for the value.

For example, you have added a custom merge key called “Customer ID”. You can configure ap3c.track like so:

 ap3c.track ({ ac: [{ “fi”: “str:cm:customer-id”, “v”:“<value>” }]})

You can add additional user data to the payload, but if you want to associate sessions using the custom merge key only, that’s all you need to provide.