Skip to content

Commit c7a201b

Browse files
authored
Merge pull request #3456 from segmentio/3419-custom-external-ids
Custom externalIDs section updates
2 parents 66f768c + 234eda8 commit c7a201b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/personas/identity-resolution/externalids.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ Segment automatically promotes the following traits and IDs in track and identif
2828
| ios.idfa | context.device.advertisingId when context.device.type = 'ios' |
2929
| ios.push_token | context.device.token when context.device.type = 'ios' |
3030

31-
3231
## Custom externalIDs
3332

34-
Personas will automatically resolve identity for any other externalIDs that you bind to users - such as a phone number or any custom identifier that you support. As seen in the below example, you can send custom `externalIds` in the `context` object of any call to Segment's API.
33+
Personas will automatically resolve identity for any other externalIDs that you bind to users - such as a phone number or any custom identifier that you support.
34+
35+
As long as you've configured custom externalIDs, such as `phone`, in your Space's Identity Resolution rules, you can include it with the `context.externalIds` array, the `properties` object, or the `context.traits` object.
36+
37+
As seen in the example below, you can send custom `externalIds` in the `context` object of any call to Segment's API.
3538

3639
The four fields below (id, type, collection, encoding) are all required:
3740

@@ -59,8 +62,16 @@ analytics.track('Subscription Upgraded', {
5962
]
6063
})
6164
```
65+
Additionally, adding `phone` with the `properties` object gets picked up by Personas and applied as an externalID:
66+
```js
67+
analytics.track('Subscription Upgraded', { plan: 'Pro', mrr: 99.99, phone: '123-456-7890'})
68+
```
69+
You can also include `phone` using the [`context.traits`](/docs/connections/sources/catalog/libraries/website/javascript/identity/#saving-traits-to-the-context-object) object and Personas adds it to the profile as an externalID.
6270

63-
Personas will automatically create a user (user_id: `use_123`) with the custom externalId (phone: `123-456-7890`). Then, you query the users phone record by using the external id (phone: `123-456-7890`), or update this profile using that externalId going forward. (Note: externalIDs must be lower-case.)
71+
```js
72+
analytics.track('Subscription Upgraded', { plan: 'Pro', mrr: 99.99}, {traits : {phone_number: '123-456-7890'}})
73+
```
74+
Personas will automatically create a user (user_id: `use_123`) with the custom externalID (phone: `123-456-7890`). Query the user's phone record using the externalID (phone: `123-456-7890`), or update the profile with that externalID going forward. (Note: externalIDs must be lower-case.)
6475

6576
## Viewing promoted externalIDs
6677

0 commit comments

Comments
 (0)