-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add DATA WAREHOUSE to integrations object in shopify pixel sour…
…ce (#3980) * feat: add redis support in shopify pixel for id stitching * chore: update redis set structure * chore: update attribute name Co-authored-by: Utsab Chowdhury <[email protected]> * fix: stitched events through redis in pixel * fix: stitched events through redis in pixel * fix: stitched events through redis in pixel * chore: add tests * chore: add campaign object support in web pixel events (#3973) * chore: add campaign object support in web pixel events * chore: add custom utm support * chore: address comments * feat: add DATA WAREHOUSE to intg object in shopify pixel * feat: add DATA WAREHOUSE json path handling for some providers * chore: update json structure to be event specific in shopify * chore: add test * chore: add testx2 * chore: resolve conflict * chore: address comments, refactor wh changes * chore: refactor * chore: resolve conflicts * chore: fix test * feat: add redis support in shopify pixel for id stitching (#3957) * feat: add redis support in shopify pixel for id stitching (#3957) * chore: fix redis test * chore: pixelEventLabel for identifier events also * fix: redis await missing * fix: setProperty issue * fix: refactor basic code flow * chore: handle imports, await functions * chore: add pixel prefix for redis carttoken in shopify * chore: address comments * chore: add stat for serverside missing cart token * chore: add unit test for utm param extractfunction * chore: fix sonar issues in wh index js --------- Co-authored-by: Utsab Chowdhury <[email protected]>
- Loading branch information
1 parent
23ad10a
commit 3c20393
Showing
11 changed files
with
243 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
const event = { | ||
"request": { | ||
"query": { | ||
"whSchemaVersion": "v1" | ||
} | ||
}, | ||
"message": { | ||
"context": { | ||
"shopifyDetails": { | ||
"id": 5778367414385, | ||
"current_total_tax": "10.00", | ||
"current_total_tax_set": { | ||
"shop_money": { | ||
"amount": "10.00", | ||
"currency_code": "USD" | ||
}, | ||
}, | ||
"name": "#1017", | ||
"phone": null, | ||
} | ||
}, | ||
"integrations": { | ||
"SHOPIFY": true, | ||
"DATA_WAREHOUSE": { | ||
"options": { | ||
"jsonPaths": [ | ||
"track.context.shopifyDetails" | ||
] | ||
} | ||
} | ||
}, | ||
"type": "track", | ||
"event": "Order Updated", | ||
"properties": { | ||
"order_id": "5778367414385", | ||
"currency": "USD", | ||
"products": [ | ||
{ | ||
"product_id": "7234590408817", | ||
"price": 600, | ||
"quantity": 1 | ||
} | ||
] | ||
}, | ||
"userId": "123321", | ||
"traits": {}, | ||
"timestamp": "2024-01-01T01:23:45.678Z", | ||
}, | ||
"destination": { | ||
"Config": {}, | ||
} | ||
}; | ||
|
||
/* | ||
Test for warehouse agnostic DATA_WAREHOUSE JSON column support for Shopify source | ||
*/ | ||
describe('DATA_WAREHOUSE integrations', () => { | ||
it('should process event and return responses for common providers for agnostic support', () => { | ||
const responses = require('../../src/v0/destinations/snowflake/transform').process(event); | ||
expect(responses).toHaveLength(2); | ||
expect(responses[0].metadata.table).toBe('TRACKS'); | ||
expect(responses[1].metadata.table).toBe('ORDER_UPDATED'); | ||
|
||
expect(responses[0].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); | ||
expect(responses[0].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); | ||
|
||
expect(responses[1].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); | ||
expect(responses[1].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); | ||
}); | ||
|
||
it('should process event and return response for other providers like mssql', () => { | ||
const responses = require('../../src/v0/destinations/mssql/transform').process(event); | ||
expect(responses).toHaveLength(2); | ||
expect(responses[0].metadata.table).toBe('tracks'); | ||
expect(responses[1].metadata.table).toBe('order_updated'); | ||
|
||
expect(responses[0].metadata.columns.context_shopify_details).toBe(undefined); | ||
expect(responses[0].metadata.columns.context_shopify_details_id).toBe('int'); | ||
expect(responses[0].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); | ||
expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); | ||
expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); | ||
expect(responses[0].metadata.columns.context_shopify_details_name).toBe('string'); | ||
expect(responses[0].data.context_shopify_details).toBe(undefined); | ||
expect(responses[0].data.context_shopify_details_id).toBe(5778367414385); | ||
expect(responses[0].data.context_shopify_details_current_total_tax).toBe('10.00'); | ||
expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); | ||
expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); | ||
expect(responses[0].data.context_shopify_details_name).toBe('#1017'); | ||
|
||
expect(responses[1].metadata.columns.context_shopify_details).toBe(undefined); | ||
expect(responses[1].metadata.columns.context_shopify_details_id).toBe('int'); | ||
expect(responses[1].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); | ||
expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); | ||
expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); | ||
expect(responses[1].metadata.columns.context_shopify_details_name).toBe('string'); | ||
expect(responses[1].data.context_shopify_details).toBe(undefined); | ||
expect(responses[1].data.context_shopify_details_id).toBe(5778367414385); | ||
expect(responses[1].data.context_shopify_details_current_total_tax).toBe('10.00'); | ||
expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); | ||
expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); | ||
expect(responses[1].data.context_shopify_details_name).toBe('#1017'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.