Skip to content

Commit

Permalink
feat: add clickId support for tiktok and pinterest destination (#2784)
Browse files Browse the repository at this point in the history
* feat: add clickId support for tiktok

* feat: add clickId support for pinterest

* chore: add clickId in tests

* chore: correct mapping for tiktok

* chore: remove instances of callback in input

* fix: add clickId in tests

* fix: revert context.page mapping
  • Loading branch information
ujjwal-ab authored Nov 10, 2023
1 parent 42bec54 commit 0e14296
Show file tree
Hide file tree
Showing 5 changed files with 4,675 additions and 4,721 deletions.
8 changes: 4 additions & 4 deletions src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ steps:
"hashed_maids": .context.device.advertisingId,
"client_ip_address": .context.ip ?? .request_ip,
"client_user_agent": .context.userAgent,
"external_id": {{{{$.getGenericPaths("userId")}}}}
"external_id": {{{{$.getGenericPaths("userId")}}}},
"click_id": .properties.clickId
});
!.destination.Config.sendExternalId ? userFields = userFields{~["external_id"]} : null;
userFields = $.removeUndefinedAndNullAndEmptyValues(userFields);
Expand Down Expand Up @@ -185,14 +186,13 @@ steps:
- name: payload
template: |
$.outputs.eventNames.().({...$.outputs.basePayload, event_name: .})[]
- name: checkSendTestEventConfig
description: |
If sendTestEvent is enabled, we send test event to the destination
ref: https://help.pinterest.com/en/business/article/track-conversions-with-the-conversions-api
template: |
^.destination.Config.sendAsTestEvent ? {"test": true} : {}
^.destination.Config.sendAsTestEvent ? {"test": true} : {}
- name: buildResponseForBatchMode
description: In batchMode we return payload directly
Expand Down
5 changes: 5 additions & 0 deletions src/v0/destinations/tiktok_ads/data/TikTokTrack.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
"sourceKeys": ["properties.context.ad", "context.ad"],
"required": false
},
{
"destKey": "context.ad.callback",
"sourceKeys": "properties.clickId",
"required": false
},
{
"destKey": "context.page",
"sourceKeys": ["properties.context.page", "context.page"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const data = [
order_id: '50314b8e9bcf000000000000',
requestIP: '123.0.0.0',
optOutType: 'LDP',
clickId: 'dummy_clickId',
products: [
{
sku: '45790-32',
Expand Down Expand Up @@ -132,6 +133,7 @@ export const data = [
'6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090',
],
client_user_agent: 'chrome',
click_id: 'dummy_clickId',
ge: ['1b16b1df538ba12dc3f97edbb85caa7050d46c148134290feba80f8236c83db9'],
},
custom_data: {
Expand Down
Loading

0 comments on commit 0e14296

Please sign in to comment.