Repository: rudderlabs/rudder-transformer
Pull request #4298: feat: add new event mapping for tiktok
Author: login: maheshkutty
Created: 2025-05-06T05:47:22Z | Merged: 2025-05-08T06:59:35Z

## What are the changes introduced in this PR?

Added a new mapping for TikTok ads. Below is the list:
* Purchase
* Lead
* CustomizeProduct
* FindLocation
* Schedule

Tiktok standred event link:
https://ads.tiktok.com/help/article/standard-events-parameters?lang=en

## What is the related Linear task?

Resolves INT-3610

## Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, **mandatorily** mention them here

### Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

### Any new dependencies introduced with this change?

N/A

### Any new generic utility introduced or modified. Please explain the changes.

N/A

### Any technical or performance related pointers to consider with the change?

N/A

@coderabbitai review

<hr>

### Developer checklist

- [ ] My code follows the style guidelines of this project

- [ ] **No breaking changes are being introduced.**

- [ ] All related docs linked with the PR?

- [ ] All changes manually tested?

- [ ] Any documentation changes needed with this change?

- [ ] Is the PR limited to 10 file changes?

- [ ] Is the PR limited to one linear task?

- [ ] Are relevant unit and component test-cases added in **new readability format**?

### Reviewer checklist

- [ ] Is the type of change in the PR title appropriate as per the changes?

- [ ] Verified that there are no credentials or confidential data exposed with the changes.



Diff:
diff --git a/src/v0/destinations/tiktok_ads/config.js b/src/v0/destinations/tiktok_ads/config.js
index e3a49755e5..6976a26123 100644
--- a/src/v0/destinations/tiktok_ads/config.js
+++ b/src/v0/destinations/tiktok_ads/config.js
@@ -17,6 +17,10 @@ const ConfigCategory = {
 
 const PARTNER_NAME = 'RudderStack';
 
+// We need to remove 'checkout step completed' and 'submitform' from the list of events as per tiktok docs
+// tiktok changed the mapping for 'checkout step completed => purchase' and 'submitform => lead'
+// once all customer migrate to new event we can remove old mapping
+// https://ads.tiktok.com/help/article/standard-events-parameters?lang=en
 const eventNameMapping = {
   'product added to wishlist': 'AddToWishlist',
   'product added': 'AddToCart',
@@ -32,6 +36,11 @@ const eventNameMapping = {
   submitform: 'SubmitForm',
   completeregistration: 'CompleteRegistration',
   subscribe: 'Subscribe',
+  purchase: 'Purchase',
+  lead: 'Lead',
+  customizeproduct: 'CustomizeProduct',
+  findlocation: 'FindLocation',
+  schedule: 'Schedule',
 };
 
 const mappingConfig = getMappingConfig(ConfigCategory, __dirname);
diff --git a/test/integrations/destinations/tiktok_ads/processor/data.ts b/test/integrations/destinations/tiktok_ads/processor/data.ts
index e6fe407381..90211a0d09 100644
--- a/test/integrations/destinations/tiktok_ads/processor/data.ts
+++ b/test/integrations/destinations/tiktok_ads/processor/data.ts
@@ -7129,4 +7129,339 @@ export const data = [
       },
     },
   },
+  {
+    name: 'tiktok_ads',
+    description: 'Testing the purchase event',
+    feature: 'processor',
+    module: 'destination',
+    version: 'v0',
+    input: {
+      request: {
+        body: [
+          {
+            message: {
+              anonymousId: '21e13f4bc7ceddad',
+              channel: 'web',
+              context: {
+                app: {
+                  build: '1.0.0',
+                  name: 'RudderLabs JavaScript SDK',
+                  namespace: 'com.rudderlabs.javascript',
+                  version: '1.0.0',
+                },
+                library: {
+                  name: 'RudderLabs JavaScript SDK',
+                  version: '1.0.0',
+                },
+                userAgent:
+                  'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                ip: '13.57.97.131',
+                locale: 'en-US',
+                os: {
+                  name: '',
+                  version: '',
+                },
+                screen: {
+                  density: 2,
+                },
+                externalId: [
+                  {
+                    type: 'tiktokExternalId',
+                    id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                  },
+                ],
+              },
+              messageId: '84e26acc-56a5-4835-8233-591137fca468',
+              session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+              originalTimestamp: '2019-10-14T09:03:17.562Z',
+              timestamp: '2020-09-17T19:49:27Z',
+              type: 'track',
+              event: 'purchase',
+              properties: {
+                eventId: '1616318632825_357',
+                contents: [
+                  {
+                    price: 8,
+                    quantity: 2,
+                    content_type: 'socks',
+                    content_id: '1077218',
+                  },
+                  {
+                    price: 30,
+                    quantity: 1,
+                    content_type: 'dress',
+                    content_id: '1197218',
+                  },
+                ],
+                clickId: 'dummyclickId',
+                currency: 'USD',
+                value: 46,
+                context: {
+                  ad: {
+                    callback: '123ATXSfe',
+                  },
+                  page: {
+                    url: 'http://demo.mywebsite.com/purchase',
+                    referrer: 'http://demo.mywebsite.com',
+                  },
+                  user: {
+                    phone_number:
+                      '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                    email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                  },
+                },
+              },
+              integrations: {
+                All: true,
+              },
+              sentAt: '2019-10-14T09:03:22.563Z',
+            },
+            destination: {
+              Config: {
+                accessToken: 'dummyAccessToken',
+                pixelCode: '{{PIXEL-CODE}}',
+                hashUserProperties: false,
+              },
+            },
+          },
+        ],
+      },
+    },
+    output: {
+      response: {
+        status: 200,
+        body: [
+          {
+            output: {
+              version: '1',
+              type: 'REST',
+              method: 'POST',
+              endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/',
+              headers: {
+                'Access-Token': 'dummyAccessToken',
+                'Content-Type': 'application/json',
+              },
+              params: {},
+              body: {
+                JSON: {
+                  pixel_code: '{{PIXEL-CODE}}',
+                  event: 'Purchase',
+                  event_id: '1616318632825_357',
+                  timestamp: '2020-09-17T19:49:27Z',
+                  properties: {
+                    contents: [
+                      {
+                        price: 8,
+                        quantity: 2,
+                        content_type: 'socks',
+                        content_id: '1077218',
+                      },
+                      {
+                        price: 30,
+                        quantity: 1,
+                        content_type: 'dress',
+                        content_id: '1197218',
+                      },
+                    ],
+                    currency: 'USD',
+                    value: 46,
+                  },
+                  context: {
+                    ad: {
+                      callback: 'dummyclickId',
+                    },
+                    page: {
+                      url: 'http://demo.mywebsite.com/purchase',
+                      referrer: 'http://demo.mywebsite.com',
+                    },
+                    user: {
+                      phone_number:
+                        '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                      email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                      external_id:
+                        'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                    },
+                    ip: '13.57.97.131',
+                    user_agent:
+                      'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                  },
+                  partner_name: 'RudderStack',
+                },
+                JSON_ARRAY: {},
+                XML: {},
+                FORM: {},
+              },
+              files: {},
+              userId: '',
+            },
+            statusCode: 200,
+          },
+        ],
+      },
+    },
+  },
+  {
+    name: 'tiktok_ads',
+    description: 'Testing the lead event',
+    feature: 'processor',
+    module: 'destination',
+    version: 'v0',
+    input: {
+      request: {
+        body: [
+          {
+            message: {
+              anonymousId: '21e13f4bc7ceddad',
+              channel: 'web',
+              context: {
+                app: {
+                  build: '1.0.0',
+                  name: 'RudderLabs JavaScript SDK',
+                  namespace: 'com.rudderlabs.javascript',
+                  version: '1.0.0',
+                },
+                library: {
+                  name: 'RudderLabs JavaScript SDK',
+                  version: '1.0.0',
+                },
+                userAgent:
+                  'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                locale: 'en-US',
+                ip: '13.57.97.131',
+                os: {
+                  name: '',
+                  version: '',
+                },
+                screen: {
+                  density: 2,
+                },
+                externalId: [
+                  {
+                    type: 'tiktokExternalId',
+                    id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                  },
+                ],
+              },
+              messageId: '84e26acc-56a5-4835-8233-591137fca468',
+              session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+              originalTimestamp: '2019-10-14T09:03:17.562Z',
+              timestamp: '2020-09-17T19:49:27Z',
+              type: 'track',
+              event: 'lead',
+              properties: {
+                eventId: '16163186328257',
+                context: {
+                  page: {
+                    url: 'http://demo.mywebsite.com/purchase',
+                    referrer: 'http://demo.mywebsite.com',
+                  },
+                  user: {
+                    phone_number:
+                      '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                    email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                  },
+                },
+                contents: [
+                  {
+                    price: 8,
+                    quantity: 2,
+                    content_type: 'socks',
+                    content_id: '1077218',
+                  },
+                  {
+                    price: 30,
+                    quantity: 1,
+                    content_type: 'dress',
+                    content_id: '1197218',
+                  },
+                ],
+                currency: 'USD',
+                value: 46,
+              },
+              integrations: {
+                All: true,
+              },
+              sentAt: '2019-10-14T09:03:22.563Z',
+            },
+            destination: {
+              Config: {
+                accessToken: 'dummyAccessToken',
+                pixelCode: '{{PIXEL-CODE}}',
+                hashUserProperties: false,
+              },
+            },
+          },
+        ],
+      },
+    },
+    output: {
+      response: {
+        status: 200,
+        body: [
+          {
+            output: {
+              version: '1',
+              type: 'REST',
+              method: 'POST',
+              endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/',
+              headers: {
+                'Access-Token': 'dummyAccessToken',
+                'Content-Type': 'application/json',
+              },
+              params: {},
+              body: {
+                JSON: {
+                  pixel_code: '{{PIXEL-CODE}}',
+                  event: 'Lead',
+                  event_id: '16163186328257',
+                  timestamp: '2020-09-17T19:49:27Z',
+                  properties: {
+                    contents: [
+                      {
+                        price: 8,
+                        quantity: 2,
+                        content_type: 'socks',
+                        content_id: '1077218',
+                      },
+                      {
+                        price: 30,
+                        quantity: 1,
+                        content_type: 'dress',
+                        content_id: '1197218',
+                      },
+                    ],
+                    currency: 'USD',
+                    value: 46,
+                  },
+                  context: {
+                    page: {
+                      url: 'http://demo.mywebsite.com/purchase',
+                      referrer: 'http://demo.mywebsite.com',
+                    },
+                    user: {
+                      phone_number:
+                        '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                      email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                      external_id:
+                        'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                    },
+                    ip: '13.57.97.131',
+                    user_agent:
+                      'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                  },
+                  partner_name: 'RudderStack',
+                },
+                JSON_ARRAY: {},
+                XML: {},
+                FORM: {},
+              },
+              files: {},
+              userId: '',
+            },
+            statusCode: 200,
+          },
+        ],
+      },
+    },
+  },
 ];


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>

<details>
<summary>src/v0/destinations/tiktok_ads/config.js (1)</summary><blockquote>

`39-43`: **New event mappings align with TikTok documentation.**

The added event mappings follow the established naming convention (lowercase keys to PascalCase values) and properly implement the new recommended event types from TikTok. This enhances the integration capabilities while maintaining backward compatibility.

Consider adding a TODO comment with a timeline or criteria for when the deprecated mappings should be removed to ensure this technical debt is addressed in the future.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 88d90bdc7862df731407608b6db037b2c162b820 and ea2582e7e0d5713f3d5ea110aa20fa1d7a39e2f2.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `test/integrations/destinations/tiktok_ads/processor/data.ts` is excluded by `!**/test/**`

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/v0/destinations/tiktok_ads/config.js` (2 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (1)</summary>

<details>
<summary>`**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).</summary>

> `**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).

- `src/v0/destinations/tiktok_ads/config.js`

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (9)</summary>

* GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
* GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
* GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
* GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
* GitHub Check: Code Coverage
* GitHub Check: test_and_publish
* GitHub Check: UT Tests
* GitHub Check: Analyze (javascript-typescript)
* GitHub Check: Analyze (go)

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>src/v0/destinations/tiktok_ads/config.js (1)</summary>

`20-23`: **Good documentation for future maintenance.**

The comment clearly explains why certain event mappings are being kept for backward compatibility despite being deprecated according to TikTok's updated documentation. Including the link to official documentation is helpful for future reference.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T05:49:22Z
user: login: manish339k
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T14:05:37Z
user: login: maheshkutty
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T14:53:43Z
user: login: manish339k
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T05:23:32Z
user: login: manish339k
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T05:27:27Z
user: login: krishna2020
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-08T06:57:59Z

Review comments:
diff_hunk: @@ -7129,4 +7129,339 @@ export const data = [
       },
     },
   },
+  {
+    name: 'tiktok_ads',
+    description: 'Testing the purchase event',
+    feature: 'processor',
+    module: 'destination',
+    version: 'v0',
+    input: {
+      request: {
+        body: [
+          {
+            message: {
+              anonymousId: '21e13f4bc7ceddad',
+              channel: 'web',
+              context: {
+                app: {
+                  build: '1.0.0',
+                  name: 'RudderLabs JavaScript SDK',
+                  namespace: 'com.rudderlabs.javascript',
+                  version: '1.0.0',
+                },
+                library: {
+                  name: 'RudderLabs JavaScript SDK',
+                  version: '1.0.0',
+                },
+                userAgent:
+                  'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                ip: '13.57.97.131',
+                locale: 'en-US',
+                os: {
+                  name: '',
+                  version: '',
+                },
+                screen: {
+                  density: 2,
+                },
+                externalId: [
+                  {
+                    type: 'tiktokExternalId',
+                    id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                  },
+                ],
+              },
+              messageId: '84e26acc-56a5-4835-8233-591137fca468',
+              session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+              originalTimestamp: '2019-10-14T09:03:17.562Z',
+              timestamp: '2020-09-17T19:49:27Z',
+              type: 'track',
+              event: 'purchase',
+              properties: {
+                eventId: '1616318632825_357',
+                contents: [
+                  {
+                    price: 8,
+                    quantity: 2,
+                    content_type: 'socks',
+                    content_id: '1077218',
+                  },
+                  {
+                    price: 30,
+                    quantity: 1,
+                    content_type: 'dress',
+                    content_id: '1197218',
+                  },
+                ],
+                clickId: 'dummyclickId',
+                currency: 'USD',
+                value: 46,
+                context: {
+                  ad: {
+                    callback: '123ATXSfe',
+                  },
+                  page: {
+                    url: 'http://demo.mywebsite.com/purchase',
+                    referrer: 'http://demo.mywebsite.com',
+                  },
+                  user: {
+                    phone_number:
+                      '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                    email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                  },
+                },
+              },
+              integrations: {
+                All: true,
+              },
+              sentAt: '2019-10-14T09:03:22.563Z',
+            },
+            destination: {
+              Config: {
+                accessToken: 'dummyAccessToken',
path: test/integrations/destinations/tiktok_ads/processor/data.ts
user: login: manish339k
body: Why are we not using the maskedSecrets?
created_at: 2025-05-06T14:05:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -7129,4 +7129,339 @@ export const data = [
       },
     },
   },
+  {
+    name: 'tiktok_ads',
+    description: 'Testing the purchase event',
+    feature: 'processor',
+    module: 'destination',
+    version: 'v0',
+    input: {
+      request: {
+        body: [
+          {
+            message: {
+              anonymousId: '21e13f4bc7ceddad',
+              channel: 'web',
+              context: {
+                app: {
+                  build: '1.0.0',
+                  name: 'RudderLabs JavaScript SDK',
+                  namespace: 'com.rudderlabs.javascript',
+                  version: '1.0.0',
+                },
+                library: {
+                  name: 'RudderLabs JavaScript SDK',
+                  version: '1.0.0',
+                },
+                userAgent:
+                  'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                ip: '13.57.97.131',
+                locale: 'en-US',
+                os: {
+                  name: '',
+                  version: '',
+                },
+                screen: {
+                  density: 2,
+                },
+                externalId: [
+                  {
+                    type: 'tiktokExternalId',
+                    id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                  },
+                ],
+              },
+              messageId: '84e26acc-56a5-4835-8233-591137fca468',
+              session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+              originalTimestamp: '2019-10-14T09:03:17.562Z',
+              timestamp: '2020-09-17T19:49:27Z',
+              type: 'track',
+              event: 'purchase',
+              properties: {
+                eventId: '1616318632825_357',
+                contents: [
+                  {
+                    price: 8,
+                    quantity: 2,
+                    content_type: 'socks',
+                    content_id: '1077218',
+                  },
+                  {
+                    price: 30,
+                    quantity: 1,
+                    content_type: 'dress',
+                    content_id: '1197218',
+                  },
+                ],
+                clickId: 'dummyclickId',
+                currency: 'USD',
+                value: 46,
+                context: {
+                  ad: {
+                    callback: '123ATXSfe',
+                  },
+                  page: {
+                    url: 'http://demo.mywebsite.com/purchase',
+                    referrer: 'http://demo.mywebsite.com',
+                  },
+                  user: {
+                    phone_number:
+                      '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                    email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                  },
+                },
+              },
+              integrations: {
+                All: true,
+              },
+              sentAt: '2019-10-14T09:03:22.563Z',
+            },
+            destination: {
+              Config: {
+                accessToken: 'dummyAccessToken',
path: test/integrations/destinations/tiktok_ads/processor/data.ts
user: login: maheshkutty
body: For all the tests of TikTok Ads, we hardcoded the accessToken, I will raise another to fix the tests
created_at: 2025-05-06T14:53:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -7129,4 +7129,339 @@ export const data = [
       },
     },
   },
+  {
+    name: 'tiktok_ads',
+    description: 'Testing the purchase event',
+    feature: 'processor',
+    module: 'destination',
+    version: 'v0',
+    input: {
+      request: {
+        body: [
+          {
+            message: {
+              anonymousId: '21e13f4bc7ceddad',
+              channel: 'web',
+              context: {
+                app: {
+                  build: '1.0.0',
+                  name: 'RudderLabs JavaScript SDK',
+                  namespace: 'com.rudderlabs.javascript',
+                  version: '1.0.0',
+                },
+                library: {
+                  name: 'RudderLabs JavaScript SDK',
+                  version: '1.0.0',
+                },
+                userAgent:
+                  'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+                ip: '13.57.97.131',
+                locale: 'en-US',
+                os: {
+                  name: '',
+                  version: '',
+                },
+                screen: {
+                  density: 2,
+                },
+                externalId: [
+                  {
+                    type: 'tiktokExternalId',
+                    id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+                  },
+                ],
+              },
+              messageId: '84e26acc-56a5-4835-8233-591137fca468',
+              session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+              originalTimestamp: '2019-10-14T09:03:17.562Z',
+              timestamp: '2020-09-17T19:49:27Z',
+              type: 'track',
+              event: 'purchase',
+              properties: {
+                eventId: '1616318632825_357',
+                contents: [
+                  {
+                    price: 8,
+                    quantity: 2,
+                    content_type: 'socks',
+                    content_id: '1077218',
+                  },
+                  {
+                    price: 30,
+                    quantity: 1,
+                    content_type: 'dress',
+                    content_id: '1197218',
+                  },
+                ],
+                clickId: 'dummyclickId',
+                currency: 'USD',
+                value: 46,
+                context: {
+                  ad: {
+                    callback: '123ATXSfe',
+                  },
+                  page: {
+                    url: 'http://demo.mywebsite.com/purchase',
+                    referrer: 'http://demo.mywebsite.com',
+                  },
+                  user: {
+                    phone_number:
+                      '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+                    email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+                  },
+                },
+              },
+              integrations: {
+                All: true,
+              },
+              sentAt: '2019-10-14T09:03:22.563Z',
+            },
+            destination: {
+              Config: {
+                accessToken: 'dummyAccessToken',
path: test/integrations/destinations/tiktok_ads/processor/data.ts
user: login: manish339k
body: Okay
created_at: 2025-05-07T05:23:32Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-06T05:47:30Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Summary by CodeRabbit

- **New Features**
  - Added support for new TikTok Ads events: Purchase, Lead, CustomizeProduct, FindLocation, and Schedule.

- **Documentation**
  - Updated in-app comments to clarify upcoming changes to event mappings based on TikTok's latest documentation.
## Summary by CodeRabbit

- **New Features**
  - Added support for new TikTok Ads event types: Purchase, Lead, CustomizeProduct, FindLocation, and Schedule.

- **Documentation**
  - Updated comments to clarify upcoming changes to event mappings in line with TikTok documentation updates.

## Walkthrough

The update enhances the TikTok Ads destination configuration by appending new event mappings to the `eventNameMapping` object and adding clarifying comments about deprecating certain legacy mappings. No existing mappings were changed or removed. The changes are limited to a single configuration file.

## Changes

| File(s)                                  | Change Summary                                                                                                   |
|------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| src/v0/destinations/tiktok_ads/config.js | Added new event mappings for 'purchase', 'lead', 'customizeproduct', 'findlocation', and 'schedule'. Included comments about TikTok documentation updates and pending removal of legacy mappings. |

## Suggestions for Improvement

- Consider adding unit tests to validate the correctness of the event mappings, ensuring future updates do not introduce regressions.
- Track customer migration progress to safely remove deprecated event mappings as soon as feasible.
- Document the migration timeline and communicate it clearly to all stakeholders to avoid confusion during the transition.

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between db7da354eb4442ce0cea6d46f8374738323c121e and e2dae5a826af045d1e62ab89aaf27c01b398111e.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `test/integrations/destinations/tiktok_ads/processor/data.ts` is excluded by `!**/test/**`

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/v0/destinations/tiktok_ads/config.js` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/v0/destinations/tiktok_ads/config.js

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (7)</summary>

* GitHub Check: check-health
* GitHub Check: Check PR Title
* GitHub Check: test_and_publish
* GitHub Check: UT Tests
* GitHub Check: Check for formatting & lint errors
* GitHub Check: Analyze (javascript-typescript)
* GitHub Check: Analyze (go)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAMxJqLjRaenIAd0gSKQxQ5jRubngMIkhY/D5xAGsCSujINLRkBwFmdRp6OTDYD2xESkg87sRYSrxceUbrOwxHAX6AFgAmAE4ADhQsXG6/Em58RHVy+QpsFMovFUQAehOzijBcKgxEMoo2Cg0YbbyixlhMUgbR6KbAMKKdLaoWwoZBbDzJWjqeD4LD4WLoSDpTLZXL5QrFezcUTwWLwBhoHzyV4weCVaD4SroWiIT7uTEkNJeCZnejQWn0xmIXCYWjOehZdjI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rpRGodTkuBOXDQywNCyGNMZjbyjjybaAvL41AQtQoWAPRLRactHH9SSeLWaWTonGPiaclWk2DpinscgE5G0iZ7S1pRKp/jLlG3el005D03Qm08aaS0gwaSfFpVXeiIJnSzH0DPTPKJPSXbyE6M4xJbiUmeO8Xov+6hymyUQOU5RHI6DlP7F2cL6T9FoEWAAVlWIsEgAB2EgT5aBZfyw+G8sQbwlYSA+Z8aBMtPliGgB8tB8toBvMsEgixYiLDSy52gAh8uihvFl+YJABDzEm4sMET4wRoDvLQeYd5YirBvPl+Y+WbyrcWDeBgD5FgPg8DolzXXRQkCy2gXLd40CxCfPMLLtBDt3kWCoVYyx6s9fywwJ8D4BAddWLVw7aWDAuYsdF2L8WTqJdoOUgx+ggA= -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=rudderlabs/rudder-transformer&utm_content=4298):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: devops-github-rudderstack
created_at: 2025-05-06T05:53:21Z
body: Allure Test reports for this run are available at:
- Allure Report: [View Report](https://rudderlabs.github.io/test-reports/rudder-transformer/4298/index.html)
author_association: CONTRIBUTOR
user: login: codecov[bot]
created_at: 2025-05-06T05:54:11Z
body: ## [Codecov](https://app.codecov.io/gh/rudderlabs/rudder-transformer/pull/4298?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rudderlabs) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 91.32%. Comparing base [(`8ae3b99`)](https://app.codecov.io/gh/rudderlabs/rudder-transformer/commit/8ae3b994d32dbba9e4d24491fc9e607a1cf40a57?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rudderlabs) to head [(`e2dae5a`)](https://app.codecov.io/gh/rudderlabs/rudder-transformer/commit/e2dae5a826af045d1e62ab89aaf27c01b398111e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rudderlabs).
> Report is 13 commits behind head on develop.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff            @@
##           develop    #4298   +/-   ##
========================================
  Coverage    91.32%   91.32%           
========================================
  Files          636      636           
  Lines        33376    33376           
  Branches      7892     7892           
========================================
  Hits         30481    30481           
+ Misses        2680     2650   -30     
- Partials       215      245   +30     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/rudderlabs/rudder-transformer/pull/4298?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rudderlabs).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=rudderlabs).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE
user: login: devops-github-rudderstack
created_at: 2025-05-06T10:46:09Z
body: Allure Test reports for this run are available at:
- Allure Report: [View Report](https://rudderlabs.github.io/test-reports/rudder-transformer/4298/index.html)
author_association: CONTRIBUTOR
user: login: devops-github-rudderstack
created_at: 2025-05-06T14:46:06Z
body: Allure Test reports for this run are available at:
- Allure Report: [View Report](https://rudderlabs.github.io/test-reports/rudder-transformer/4298/index.html)
author_association: CONTRIBUTOR
user: login: sonarqubecloud[bot]
created_at: 2025-05-06T14:47:17Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=rudderlabs_rudder-transformer&pullRequest=4298) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=rudderlabs_rudder-transformer&pullRequest=4298&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=rudderlabs_rudder-transformer&pullRequest=4298&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=rudderlabs_rudder-transformer&pullRequest=4298&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=rudderlabs_rudder-transformer&pullRequest=4298&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=rudderlabs_rudder-transformer&pullRequest=4298&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=rudderlabs_rudder-transformer&pullRequest=4298)


author_association: NONE