Skip to content

Commit 401c23a

Browse files
committed
Custom externalIDs updates
1 parent f08b3b2 commit 401c23a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/personas/identity-resolution/externalids.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ Segment automatically promotes the following traits and IDs in track and identif
3131

3232
## Custom externalIDs
3333

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.
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.
35+
36+
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.
37+
38+
As seen in the example below, you can send custom `externalIds` in the `context` object of any call to Segment's API.
3539

3640
The four fields below (id, type, collection, encoding) are all required:
3741

@@ -59,8 +63,16 @@ analytics.track('Subscription Upgraded', {
5963
]
6064
})
6165
```
66+
Additionally, adding `phone` with the `properties` object gets picked up by Personas and applied as an externalID:
67+
```js
68+
analytics.track('Subscription Upgraded', { plan: 'Pro', mrr: 99.99, phone: '123-456-7890'})
69+
```
70+
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.
6271

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.)
72+
```js
73+
analytics.track('Subscription Upgraded', { plan: 'Pro', mrr: 99.99}, {traits : {phone_number: '123-456-7890'}})
74+
```
75+
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.)
6476

6577
## Viewing promoted externalIDs
6678

0 commit comments

Comments
 (0)