Skip to content

Commit 441240d

Browse files
manuelnt11Manuel Nuñeznick-Ag
authored
Add fs_user_id and web_user_id to Optimizely payload interfaces (#2789)
* Add fs_user_id and web_user_id to Optimizely payload interfaces * Add fs_user_id and web_user_id fields to Optimizely user identifiers * Generates types * Updates unit test snapshots * Manually sets snapshot expectation to address broken test * Manually sets snapshot expectation to address broken test, again --------- Co-authored-by: Manuel Nuñez <[email protected]> Co-authored-by: Nick Aguilar <[email protected]>
1 parent 7f9b1b9 commit 441240d

File tree

11 files changed

+67
-1
lines changed

11 files changed

+67
-1
lines changed

packages/destination-actions/src/destinations/optimizely-data-platform/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Array [
1717
"user_identifiers": Object {
1818
"anonymousId": "p$KWIG5p0vR(@gNw)lv@",
1919
"email": "[email protected]",
20+
"fs_user_id": "p$KWIG5p0vR(@gNw)lv@",
2021
"optimizely_vuid": "p$KWIG5p0vR(@gNw)lv@",
2122
"userId": "p$KWIG5p0vR(@gNw)lv@",
23+
"web_user_id": "p$KWIG5p0vR(@gNw)lv@",
2224
},
2325
},
2426
]
@@ -48,8 +50,10 @@ Array [
4850
"user_identifiers": Object {
4951
"anonymousId": "SjDZyt(p",
5052
"email": "[email protected]",
53+
"fs_user_id": "SjDZyt(p",
5154
"optimizely_vuid": "SjDZyt(p",
5255
"userId": "SjDZyt(p",
56+
"web_user_id": "SjDZyt(p",
5357
},
5458
},
5559
]
@@ -83,8 +87,10 @@ Array [
8387
"user_identifiers": Object {
8488
"anonymousId": "3!#ax",
8589
"email": "[email protected]",
90+
"fs_user_id": "3!#ax",
8691
"optimizely_vuid": "3!#ax",
8792
"userId": "3!#ax",
93+
"web_user_id": "3!#ax",
8894
},
8995
},
9096
]
@@ -126,8 +132,10 @@ Array [
126132
"user_identifiers": Object {
127133
"anonymousId": "WnJP3)h29qx6Q9XcA@qx",
128134
"email": "[email protected]",
135+
"fs_user_id": "WnJP3)h29qx6Q9XcA@qx",
129136
"optimizely_vuid": "WnJP3)h29qx6Q9XcA@qx",
130137
"userId": "WnJP3)h29qx6Q9XcA@qx",
138+
"web_user_id": "WnJP3)h29qx6Q9XcA@qx",
131139
},
132140
},
133141
]

packages/destination-actions/src/destinations/optimizely-data-platform/customEvent/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Array [
1717
"user_identifiers": Object {
1818
"anonymousId": "FX3MHiX9P^tIkXKVCa",
1919
"email": "[email protected]",
20+
"fs_user_id": "FX3MHiX9P^tIkXKVCa",
2021
"optimizely_vuid": "FX3MHiX9P^tIkXKVCa",
2122
"userId": "FX3MHiX9P^tIkXKVCa",
23+
"web_user_id": "FX3MHiX9P^tIkXKVCa",
2224
},
2325
},
2426
]

packages/destination-actions/src/destinations/optimizely-data-platform/customEvent/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ describe('OptimizelyDataPlatform.trackEvent', () => {
199199

200200
expect(response[0].status).toBe(201)
201201
expect(response[0].options.body).toMatchInlineSnapshot(
202-
`"[{\\"user_identifiers\\":{\\"anonymousId\\":\\"anonId1234\\",\\"userId\\":\\"user1234\\"},\\"action\\":\\"purchase\\",\\"type\\":\\"purchase\\",\\"timestamp\\":\\"2024-03-01T18:11:27.649Z\\",\\"order_id\\":\\"1234\\",\\"total\\":\\"20\\",\\"products\\":[{\\"product_id\\":\\"12345\\",\\"qty\\":2},{\\"product_id\\":\\"67890\\",\\"qty\\":5}]},{\\"user_identifiers\\":{\\"anonymousId\\":\\"anonId1234\\",\\"userId\\":\\"user1234\\"},\\"action\\":\\"purchase\\",\\"type\\":\\"purchase\\",\\"timestamp\\":\\"2024-03-01T18:11:27.649Z\\",\\"order_id\\":\\"5678\\",\\"total\\":\\"20\\",\\"products\\":[{\\"product_id\\":\\"67890\\",\\"qty\\":20},{\\"product_id\\":\\"098765\\",\\"qty\\":15}]}]"`
202+
`"[{\\"user_identifiers\\":{\\"anonymousId\\":\\"anonId1234\\",\\"userId\\":\\"user1234\\",\\"fs_user_id\\":\\"user1234\\",\\"web_user_id\\":\\"user1234\\"},\\"action\\":\\"purchase\\",\\"type\\":\\"purchase\\",\\"timestamp\\":\\"2024-03-01T18:11:27.649Z\\",\\"order_id\\":\\"1234\\",\\"total\\":\\"20\\",\\"products\\":[{\\"product_id\\":\\"12345\\",\\"qty\\":2},{\\"product_id\\":\\"67890\\",\\"qty\\":5}]},{\\"user_identifiers\\":{\\"anonymousId\\":\\"anonId1234\\",\\"userId\\":\\"user1234\\",\\"fs_user_id\\":\\"user1234\\",\\"web_user_id\\":\\"user1234\\"},\\"action\\":\\"purchase\\",\\"type\\":\\"purchase\\",\\"timestamp\\":\\"2024-03-01T18:11:27.649Z\\",\\"order_id\\":\\"5678\\",\\"total\\":\\"20\\",\\"products\\":[{\\"product_id\\":\\"67890\\",\\"qty\\":20},{\\"product_id\\":\\"098765\\",\\"qty\\":15}]}]"`
203203
)
204204
})
205205

packages/destination-actions/src/destinations/optimizely-data-platform/customEvent/generated-types.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/destination-actions/src/destinations/optimizely-data-platform/emailEvent/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ Array [
1212
"user_identifiers": Object {
1313
"anonymousId": "4v7TZkJBZ*J1n#7wW@T%",
1414
"email": "[email protected]",
15+
"fs_user_id": "4v7TZkJBZ*J1n#7wW@T%",
1516
"optimizely_vuid": "4v7TZkJBZ*J1n#7wW@T%",
1617
"userId": "4v7TZkJBZ*J1n#7wW@T%",
18+
"web_user_id": "4v7TZkJBZ*J1n#7wW@T%",
1719
},
1820
},
1921
]

packages/destination-actions/src/destinations/optimizely-data-platform/emailEvent/generated-types.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/destination-actions/src/destinations/optimizely-data-platform/fields.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ export const user_identifiers: InputField = {
5656
type: 'string',
5757
description: 'Optimizely VUID - user cookie generated created by Optimizely Javascript library',
5858
required: false
59+
},
60+
fs_user_id: {
61+
label: 'Feature Experimentation ID',
62+
type: 'string',
63+
description: 'Feature Experimentation user ID',
64+
required: false
65+
},
66+
web_user_id: {
67+
label: 'Web Experimentation ID',
68+
type: 'string',
69+
description: 'Web User ID',
70+
required: false
5971
}
6072
},
6173
default: {
@@ -78,6 +90,12 @@ export const user_identifiers: InputField = {
7890
then: { '@path': '$.properties.optimizely_vuid' },
7991
else: { '@path': '$.traits.optimizely_vuid' }
8092
}
93+
},
94+
fs_user_id: {
95+
'@path': '$.userId'
96+
},
97+
web_user_id: {
98+
'@path': '$.userId'
8199
}
82100
}
83101
}

packages/destination-actions/src/destinations/optimizely-data-platform/nonEcommCustomEvent/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Array [
1717
"user_identifiers": Object {
1818
"anonymousId": "FX3MHiX9P^tIkXKVCa",
1919
"email": "[email protected]",
20+
"fs_user_id": "FX3MHiX9P^tIkXKVCa",
2021
"optimizely_vuid": "FX3MHiX9P^tIkXKVCa",
2122
"userId": "FX3MHiX9P^tIkXKVCa",
23+
"web_user_id": "FX3MHiX9P^tIkXKVCa",
2224
},
2325
},
2426
]

packages/destination-actions/src/destinations/optimizely-data-platform/nonEcommCustomEvent/generated-types.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/destination-actions/src/destinations/optimizely-data-platform/upsertContact/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ Array [
2626
"user_identifiers": Object {
2727
"anonymousId": "uMyg@6QjI31r!",
2828
"email": "[email protected]",
29+
"fs_user_id": "uMyg@6QjI31r!",
2930
"optimizely_vuid": "uMyg@6QjI31r!",
3031
"userId": "uMyg@6QjI31r!",
32+
"web_user_id": "uMyg@6QjI31r!",
3133
},
3234
},
3335
]

0 commit comments

Comments
 (0)