Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(optimzely_fullstack): removed empty values from common payload #2299

Merged
merged 2 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ bindings:
exportAll: true
- name: removeUndefinedAndNullValues
path: ../../../../v0/util
- name: removeUndefinedNullEmptyExclBoolInt
path: ../../../../v0/util
- name: defaultRequestConfig
path: ../../../../v0/util
- name: getIntegrationsObj
Expand Down Expand Up @@ -100,7 +102,7 @@ steps:
"enrich_decisions": .destination.Config.enrichDecisions || true,
...$.CLIENT_INFO
}
$.removeUndefinedAndNullValues(commonPayload);
$.removeUndefinedNullEmptyExclBoolInt(commonPayload);

- name: getAttributes
description: Retrieves the attribute mapping from the webapp, obtains the attribute IDs from a data file, and prepares the attributes object based on the mapping and trait values.
Expand Down
111 changes: 111 additions & 0 deletions test/__tests__/data/optimizely_fullstack.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,117 @@
"files": {}
}
},
{
"description": "Identify call (Decision Event) with projectId is empty",
"input": {
"message": {
"type": "identify",
"channel": "web",
"properties": {},
"context": {
"traits": {
"organization": "RudderStack",
"fullName": "John Doe",
"country": "US"
},
"sessionId": 1685626914716
},
"rudderId": "8f8fa6b5-8e24-489c-8e22-61f23f2e364f",
"messageId": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff",
"anonymousId": "97c46c81-3140-456d-b2a9-690d70aaca35",
"timestamp": "2023-02-10T12:16:07.251Z",
"userId": "userId123",
"integrations": {
"All": true,
"optimizely_fullstack": {
"variationId": "test_variation_id_1"
}
}
},
"destination": {
"Config": {
"dataFileUrl": "https://cdn.optimizely.com/datafiles/abc.json",
"accountId": "test_account_id",
"campaignId": "test_campaign_id",
"experimentId": "test_experiment_id",
"trackKnownUsers": true,
"projectId": "",
"attributeMapping": [
{
"from": "organization",
"to": "company"
},
{
"from": "fullName",
"to": "name"
}
]
}
}
},
"output": {
"version": "1",
"type": "REST",
"method": "POST",
"endpoint": "https://logx.optimizely.com/v1/events",
"headers": {
"Content-Type": "application/json"
},
"params": {},
"body": {
"JSON": {
"account_id": "test_account_id",
"anonymize_ip": false,
"enrich_decisions": true,
"client_name": "RudderStack",
"client_version": "1.0.0",
"visitors": [
{
"visitor_id": "userId123",
"attributes": [
{
"entity_id": "test_attribute_id_5",
"key": "company",
"type": "custom",
"value": "RudderStack"
},
{
"entity_id": "test_attribute_id_2",
"key": "name",
"type": "custom",
"value": "John Doe"
}
],
"snapshots": [
{
"decisions": [
{
"campaign_id": "test_campaign_id",
"experiment_id": "test_experiment_id",
"variation_id": "test_variation_id_1"
}
],
"events": [
{
"entity_id": "test_campaign_id",
"type": "campaign_activated",
"timestamp": 1676031367251,
"uuid": "2116ef8c-efc3-4ca4-851b-02ee60dad6ff"
}
]
}
],
"session_id": "1685626914716"
}
]
},
"JSON_ARRAY": {},
"XML": {},
"FORM": {}
},
"files": {}
}
},
{
"description": "Track call (Conversion event) with userId",
"input": {
Expand Down