From 940b756669f825e51e965b6074a79e03c1131bad Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Fri, 15 Dec 2023 17:51:15 +0530 Subject: [PATCH 1/2] fix: enhancement and version upgrade of gaec --- .../config.js | 2 +- .../data/trackConfig.json | 8 + .../networkHandler.js | 2 +- .../dataDelivery/data.ts | 545 +-- .../network.ts | 470 +-- .../processor/data.ts | 3378 +++++++++-------- .../router/data.ts | 880 ++--- 7 files changed, 2697 insertions(+), 2588 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/config.js b/src/v0/destinations/google_adwords_enhanced_conversions/config.js index 66d12c34d7..8d194655f7 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/config.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const BASE_ENDPOINT = 'https://googleads.googleapis.com/v14/customers'; +const BASE_ENDPOINT = 'https://googleads.googleapis.com/v15/customers'; const CONFIG_CATEGORIES = { TRACK_CONFIG: { type: 'track', name: 'trackConfig' }, diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json b/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json index 562a77f0e8..d98b71eb5d 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json +++ b/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json @@ -129,5 +129,13 @@ "metadata": { "type": "hashToSha256" } + }, + { + "destKey": "jobId", + "sourceKeys": ["properties.jobId"], + "required": false, + "metadata": { + "type": "toInt" + } } ] diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js index 8ac432935f..842b6fdcb2 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/networkHandler.js @@ -110,7 +110,7 @@ const responseHandler = (destinationResponse) => { // Ref - https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto if (partialFailureError && partialFailureError.code !== 0) { throw new NetworkError( - `[Google Ads Offline Conversions]:: partialFailureError - ${JSON.stringify( + `[Google Adwords Enhanced Conversions]:: partialFailureError - ${JSON.stringify( partialFailureError, )}`, 400, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/data.ts index c9bfac233d..b544baaebd 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/data.ts @@ -1,290 +1,307 @@ export const data = [ - { - name: 'google_adwords_enhanced_conversions', - description: 'Test 0', - feature: 'dataDelivery', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "0987654321" + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 0', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + params: { + event: 'Product Added', + customerId: '1234567890', + destination: 'google_adwords_enhanced_conversions', + }, + body: { + JSON: { + partialFailure: true, + conversionAdjustments: [ + { + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currency: 'INR', + }, + order_id: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, }, - "params": { - "event": "Product Added", - "customerId": "1234567890", - "destination": "google_adwords_enhanced_conversions" - }, - "body": { - "JSON": { - "partialFailure": true, - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currency": "INR" - }, - "order_id": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} + ], + adjustmentType: 'ENHANCEMENT', }, - method: 'POST', + ], }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, }, - output: { - response: { - status: 401, - body: { - output: { - "message": "\"\"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\" during Google_adwords_enhanced_conversions response transformation\"", - "authErrorCategory": "REFRESH_TOKEN", - "destinationResponse": [ - { - "error": { - "code": 401, - "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", - "status": "UNAUTHENTICATED" - } - } - ], - "statTags": { - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "errorCategory": "network", - "destinationId": "Non-determininable", - "workspaceId": "Non-determininable", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination" - }, - "status": 401 - } + method: 'POST', + }, + }, + output: { + response: { + status: 401, + body: { + output: { + message: + '""Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project." during Google_adwords_enhanced_conversions response transformation"', + authErrorCategory: 'REFRESH_TOKEN', + destinationResponse: [ + { + error: { + code: 401, + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', }, + }, + ], + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', }, + status: 401, + }, }, + }, }, - { - name: 'google_adwords_enhanced_conversions', - description: 'Test 1', - feature: 'dataDelivery', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567899:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "0987654321" + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 1', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567899:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + params: { + event: 'Product Added', + customerId: '1234567899', + destination: 'google_adwords_enhanced_conversions', + }, + body: { + JSON: { + partialFailure: true, + conversionAdjustments: [ + { + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currency: 'INR', + }, + order_id: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, }, - "params": { - "event": "Product Added", - "customerId": "1234567899", - "destination": "google_adwords_enhanced_conversions" - }, - "body": { - "JSON": { - "partialFailure": true, - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currency": "INR" - }, - "order_id": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} + ], + adjustmentType: 'ENHANCEMENT', }, - method: 'POST', + ], }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, }, - output: { - response: { - status: 200, - body: { - "output": { - "destinationResponse": { - "response": [ - { - "results": [ - { - "adjustmentDateTime": "2021-01-01 12:32:45-08:00", - "adjustmentType": "ENHANCEMENT", - "conversionAction": "customers/7693729833/conversionActions/874224905", - "gclidDateTimePair": { - "conversionDateTime": "2021-01-01 12:32:45-08:00", - "gclid": "1234", - }, - "orderId": "12345", - }, - ], - }, - ], - "status": 200, - }, - "message": "Request Processed Successfully", - "status": 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + destinationResponse: { + response: [ + { + results: [ + { + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/7693729833/conversionActions/874224905', + gclidDateTimePair: { + conversionDateTime: '2021-01-01 12:32:45-08:00', + gclid: '1234', + }, + orderId: '12345', }, + ], }, + ], + status: 200, }, + message: 'Request Processed Successfully', + status: 200, + }, }, + }, }, - { - name: 'google_adwords_enhanced_conversions', - description: 'Test 2', - feature: 'dataDelivery', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567891:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "0987654321" + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 2', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567891:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + params: { + event: 'Product Added', + customerId: '1234567891', + destination: 'google_adwords_enhanced_conversions', + }, + body: { + JSON: { + partialFailure: true, + conversionAdjustments: [ + { + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currency: 'INR', + }, + order_id: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, }, - "params": { - "event": "Product Added", - "customerId": "1234567891", - "destination": "google_adwords_enhanced_conversions" - }, - "body": { - "JSON": { - "partialFailure": true, - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currency": "INR" - }, - "order_id": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} + ], + adjustmentType: 'ENHANCEMENT', }, - method: 'POST', + ], }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, }, - output: { - response: { - status: 400, - body: { - "output": { - "destinationResponse": [ - { - results: [ - { - "conversionAction": { - "id": 123434342, - } - } - ] - } - ], - "message": "\" during Google_adwords_enhanced_conversions response transformation", - "statTags": { - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "destinationId": "Non-determininable", - "errorCategory": "network", - "errorType": "aborted", - "feature": "dataDelivery", - "implementation": "native", - "module": "destination", - "workspaceId": "Non-determininable", - }, - "status": 400, + method: 'POST', + }, + }, + output: { + response: { + status: 400, + body: { + output: { + destinationResponse: [ + { + results: [ + { + conversionAction: { + id: 123434342, }, - }, + }, + ], + }, + ], + message: '" during Google_adwords_enhanced_conversions response transformation', + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + destinationId: 'Non-determininable', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'Non-determininable', }, + status: 400, + }, }, - } + }, + }, + }, ]; diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts index ca49ea30ab..672cd73bf7 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts @@ -1,236 +1,276 @@ export const networkCallsData = [ - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567890/googleAds:searchStream', - data: { - query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, - }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', - }, - method: 'POST', - }, - httpRes: { - "data": [ - { - "error": { - "code": 401, - "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", - "status": "UNAUTHENTICATED" - } - } - ], - "status": 401 + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567890/googleAds:searchStream', + data: { + query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, + }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + error: { + code: 401, + message: + 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + status: 'UNAUTHENTICATED', + }, }, + ], + status: 401, }, - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567899/googleAds:searchStream', - data: { - query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'` - }, - params: { destination: 'google_adwords_enhanced_conversion' }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', + }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567899/googleAds:searchStream', + data: { + query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, + }, + params: { destination: 'google_adwords_enhanced_conversion' }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + results: [ + { + conversionAction: { + id: 123434342, + }, }, - method: 'POST', - }, - httpRes: { - data: [{ - results: [{ - conversionAction: { - id: 123434342 - } - }] - }], - status: 200, + ], }, + ], + status: 200, }, - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567899:uploadConversionAdjustments', - data: { - conversionAdjustments: [{ - adjustmentDateTime: '2022-01-01 12:32:45-08:00', - adjustmentType: 'ENHANCEMENT', - conversionAction: 'customers/1234567899/conversionActions/123434342', - gclidDateTimePair: { - conversionDateTime: '2022-01-01 12:32:45-08:00', - gclid: 'gclid1234' - }, - order_id: '10000', - restatementValue: { adjustedValue: 10, currency: 'INR' }, - userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - userIdentifiers: [{ - addressInfo: { - hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', - hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', - hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550' - } - }] - }], - partialFailure: true + }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567899:uploadConversionAdjustments', + data: { + conversionAdjustments: [ + { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567899/conversionActions/123434342', + gclidDateTimePair: { + conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - params: { destination: 'google_adwords_enhanced_conversion' }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', + order_id: '10000', + restatementValue: { adjustedValue: 10, currency: 'INR' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, + }, + ], + }, + ], + partialFailure: true, + }, + params: { destination: 'google_adwords_enhanced_conversion' }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + results: [ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/7693729833/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', }, - method: 'POST', - }, - httpRes: { - data: [{ - results: [{ - "adjustmentType": "ENHANCEMENT", - "conversionAction": "customers/7693729833/conversionActions/874224905", - "adjustmentDateTime": "2021-01-01 12:32:45-08:00", - "gclidDateTimePair": { - "gclid": "1234", - "conversionDateTime": "2021-01-01 12:32:45-08:00" - }, - "orderId": "12345" - }] - }], - status: 200, + ], }, + ], + status: 200, }, - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567891/googleAds:searchStream', - data: { - query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'` - }, - params: { destination: 'google_adwords_enhanced_conversion' }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', + }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567891/googleAds:searchStream', + data: { + query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, + }, + params: { destination: 'google_adwords_enhanced_conversion' }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + results: [ + { + conversionAction: { + id: 123434342, + }, }, - method: 'POST', - }, - httpRes: { - data: [{ - results: [{ - conversionAction: { - id: 123434342 - } - }] - }], - status: 200, + ], }, + ], + status: 200, }, - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567891:uploadConversionAdjustments', - data: { - conversionAdjustments: [{ - adjustmentDateTime: '2022-01-01 12:32:45-08:00', - adjustmentType: 'ENHANCEMENT', - conversionAction: 'customers/1234567891/conversionActions/123434342', - gclidDateTimePair: { - conversionDateTime: '2022-01-01 12:32:45-08:00', - gclid: 'gclid1234' - }, - order_id: '10000', - restatementValue: { adjustedValue: 10, currency: 'INR' }, - userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - userIdentifiers: [{ - addressInfo: { - hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', - hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', - hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550' - } - }] - }], - partialFailure: true - }, - params: { - destination: 'google_adwords_enhanced_conversion', - + }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadConversionAdjustments', + data: { + conversionAdjustments: [ + { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/123434342', + gclidDateTimePair: { + conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', + order_id: '10000', + restatementValue: { adjustedValue: 10, currency: 'INR' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, + }, + ], + }, + ], + partialFailure: true, + }, + params: { + destination: 'google_adwords_enhanced_conversion', + }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + results: [ + { + conversionAction: { + id: 123434342, + }, }, - method: 'POST', - }, - httpRes: { - data: [{ - results: [{ - conversionAction: { - id: 123434342 - } - }] - }], - status: 400, + ], }, + ], + status: 400, }, - { - httpReq: { - url: 'https://googleads.googleapis.com/v14/customers/1234567891:uploadClickConversions', - data: { - conversionAdjustments: [{ - adjustmentDateTime: '2022-01-01 12:32:45-08:00', - adjustmentType: 'ENHANCEMENT', - conversionAction: 'customers/1234567891/conversionActions/123434342', - gclidDateTimePair: { - conversionDateTime: '2022-01-01 12:32:45-08:00', - gclid: 'gclid1234' - }, - order_id: '10000', - restatementValue: { adjustedValue: 10, currency: 'INR' }, - userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - userIdentifiers: [{ - addressInfo: { - hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', - hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', - hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550' - } - }] - }], - partialFailure: true + }, + { + httpReq: { + url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions', + data: { + conversionAdjustments: [ + { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/123434342', + gclidDateTimePair: { + conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - params: { - destination: 'google_adwords_enhanced_conversion', - - }, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '0987654321', + order_id: '10000', + restatementValue: { adjustedValue: 10, currency: 'INR' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, + }, + ], + }, + ], + partialFailure: true, + }, + params: { + destination: 'google_adwords_enhanced_conversion', + }, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '0987654321', + }, + method: 'POST', + }, + httpRes: { + data: [ + { + results: [ + { + conversionAction: { + id: 123434342, + }, }, - method: 'POST', + ], }, - httpRes: { - data: [{ - results: [{ - conversionAction: { - id: 123434342 - } - }] - }], - status: 400, - }, - } + ], + status: 400, + }, + }, ]; - - - diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts index 09a9b406f6..1032b3b13c 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1,1694 +1,1728 @@ export const data = [ - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 0", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "123-456-7890", - "subAccount": true, - "loginCustomerId": "123-456-7890", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "countryCode": "us", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "1234567890" - }, - "params": { - "event": "Page View", - "customerId": "1234567890" - }, - "body": { - "JSON": { - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currencyCode": "INR" - }, - "orderId": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "hashedPhoneNumber": "04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe" - }, - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "countryCode": "us", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ], - "partialFailure": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '123-456-7890', + subAccount: true, + loginCustomerId: '123-456-7890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + countryCode: 'us', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 1", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '1234567890', + }, + params: { + event: 'Page View', + customerId: '1234567890', + }, + body: { + JSON: { + conversionAdjustments: [ { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currencyCode: 'INR', + }, + orderId: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + hashedPhoneNumber: + '04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe', }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Checkout Started", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + countryCode: 'us', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, }, - "statusCode": 400, - "error": "Conversion named \"Checkout Started\" was not specified in the RudderStack destination configuration", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + ], + adjustmentType: 'ENHANCEMENT', + }, + ], + partialFailure: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 2", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "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 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Product Added", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "Any of email, phone, firstName, lastName, city, street, countryCode, postalCode or streetAddress is required in traits.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Checkout Started', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 3", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "firstName": "John", - "lastName": "Gomes", - "address": { - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK", - "country": "us" - } - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Product Added", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currencyCode": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": "true", - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "11" - }, - "params": { - "event": "Product Added", - "customerId": "1234567890" - }, - "body": { - "JSON": { - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currencyCode": "INR" - }, - "orderId": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "countryCode": "us", - "hashedStreetAddress": "b28c94b2195c8ed259f0b415aaee3f39b0b2920a4537611499fa044956917a21" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ], - "partialFailure": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: + 'Conversion named "Checkout Started" was not specified in the RudderStack destination configuration', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 4", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Product Added", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currencyCode": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "orderId": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "LoginCustomerId is required as subAccount is true.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + 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 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Product Added', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 5", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "type": "identify", - "traits": { - "status": "elizabeth" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "Message Type identify is not supported. Aborting message.", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: + 'Any of email, phone, firstName, lastName, city, street, countryCode, postalCode or streetAddress is required in traits.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 6", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": null - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": null - }, - "statusCode": 500, - "error": "OAuth - access token not found", - "statTags": { - "errorCategory": "platform", - "errorType": "oAuthSecret", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + firstName: 'John', + lastName: 'Gomes', + address: { + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + country: 'us', + }, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Product Added', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currencyCode: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: 'true', + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 7", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '11', + }, + params: { + event: 'Product Added', + customerId: '1234567890', + }, + body: { + JSON: { + conversionAdjustments: [ { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currencyCode: 'INR', + }, + orderId: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + countryCode: 'us', + hashedStreetAddress: + 'b28c94b2195c8ed259f0b415aaee3f39b0b2920a4537611499fa044956917a21', + }, }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "123-456-7890", - "subAccount": true, - "loginCustomerId": "123-456-7890", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "countryCode": "us", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Product Viewed", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "orde_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 400, - "error": "Conversion named \"Product Viewed\" was not specified in the RudderStack destination configuration", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } + ], + adjustmentType: 'ENHANCEMENT', + }, + ], + partialFailure: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 8", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "requireHash": true, - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "123-456-7890", - "subAccount": true, - "loginCustomerId": "123-456-7890", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "countryCode": "us", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "1234567890" - }, - "params": { - "event": "Page View", - "customerId": "1234567890" - }, - "body": { - "JSON": { - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currencyCode": "INR" - }, - "orderId": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "hashedPhoneNumber": "04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe" - }, - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "countryCode": "us", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ], - "partialFailure": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" - }, - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "statusCode": 200 - } - ] - } - } + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Product Added', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currencyCode: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + orderId: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 9", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } - }, - "destination": { - "Config": { - "requireHash": false, - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "123-456-7890", - "subAccount": true, - "loginCustomerId": "123-456-7890", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "countryCode": "us", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: 'LoginCustomerId is required as subAccount is true.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + type: 'identify', + traits: { + status: 'elizabeth', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: 'Message Type identify is not supported. Aborting message.', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: null, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: null, + }, + statusCode: 500, + error: 'OAuth - access token not found', + statTags: { + errorCategory: 'platform', + errorType: 'oAuthSecret', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '123-456-7890', + subAccount: true, + loginCustomerId: '123-456-7890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + countryCode: 'us', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Product Viewed', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + orde_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: + 'Conversion named "Product Viewed" was not specified in the RudderStack destination configuration', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + requireHash: true, + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '123-456-7890', + subAccount: true, + loginCustomerId: '123-456-7890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + countryCode: 'us', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '1234567890', + }, + params: { + event: 'Page View', + customerId: '1234567890', + }, + body: { + JSON: { + conversionAdjustments: [ { - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "1234567890" - }, - "params": { - "event": "Page View", - "customerId": "1234567890" - }, - "body": { - "JSON": { - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currencyCode": "INR" - }, - "orderId": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "hashedPhoneNumber": "912382193" - }, - { - "addressInfo": { - "hashedFirstName": "John", - "hashedLastName": "Gomes", - "state": "UK", - "city": "London", - "countryCode": "us", - "hashedStreetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ], - "partialFailure": true - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "userId": "" + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currencyCode: 'INR', + }, + orderId: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + hashedPhoneNumber: + '04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe', }, - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + countryCode: 'us', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + }, }, - "statusCode": 200 - } - ] - } - } + ], + adjustmentType: 'ENHANCEMENT', + }, + ], + partialFailure: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + requireHash: false, + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '123-456-7890', + subAccount: true, + loginCustomerId: '123-456-7890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + countryCode: 'us', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + jobId: '1', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, }, - { - "name": "google_adwords_enhanced_conversions", - "description": "Test 10", - "feature": "processor", - "module": "destination", - "version": "v0", - "input": { - "request": { - "body": [ + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '1234567890', + }, + params: { + event: 'Page View', + customerId: '1234567890', + }, + body: { + JSON: { + conversionAdjustments: [ { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + }, + restatementValue: { + adjustedValue: 10, + currencyCode: 'INR', + }, + orderId: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + hashedPhoneNumber: '912382193', }, - "destination": { - "Config": { - "requireHash": false, - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "123-456-7890", - "subAccount": true, - "loginCustomerId": "123-456-7890", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "countryCode": "us", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - } - ] - } - }, - "output": { - "response": { - "status": 200, - "body": [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - } + { + addressInfo: { + hashedFirstName: 'John', + hashedLastName: 'Gomes', + state: 'UK', + city: 'London', + countryCode: 'us', + hashedStreetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, }, - "statusCode": 400, - "error": "Missing required value from [\"properties.orderId\",\"properties.order_id\"]", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } - ] - } - } - } -] \ No newline at end of file + ], + adjustmentType: 'ENHANCEMENT', + }, + ], + jobId: 1, + partialFailure: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 10', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + requireHash: false, + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '123-456-7890', + subAccount: true, + loginCustomerId: '123-456-7890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + countryCode: 'us', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + statusCode: 400, + error: 'Missing required value from ["properties.orderId","properties.order_id"]', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index efaa0072e2..4153630323 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -1,447 +1,457 @@ export const data = [ - { - name: 'google_adwords_enhanced_conversions', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - }, - "jobId": 1 - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - }, - { - "metadata": { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - }, - "jobId": 2 - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "type": "identify", - "traits": { - "status": "elizabeth" - }, - "userId": "emrichardson820+22822@gmail.com", - "channel": "sources", - "context": { - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - }, - "externalId": [ - { - "id": "emrichardson820+22822@gmail.com", - "type": "MAILCHIMP-92e1f1ad2c", - "identifierType": "email_address" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a", - "messageId": "b3bee036-fc26-4f6d-9867-c17f85708a82" - } - }, - { - "metadata": { - "secret": {}, - "jobId": 3 - }, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "phone": "912382193", - "firstName": "John", - "lastName": "Gomes", - "city": "London", - "state": "UK", - "streetAddress": "71 Cherry Court SOUTHAMPTON SO53 5PD UK" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "event": "Page View", - "type": "track", - "messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", - "originalTimestamp": "2019-10-14T11:15:18.299Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00", - "adjustedValue": "10", - "currency": "INR", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "partialFailure": true, - "campaignId": "1", - "templateId": "0", - "order_id": 10000, - "total": 1000, - "products": [ - { - "product_id": "507f1f77bcf86cd799439011", - "sku": "45790-32", - "name": "Monopoly: 3rd Edition", - "price": "19", - "position": "1", - "category": "cars", - "url": "https://www.example.com/product/path", - "image_url": "https://www.example.com/product/path.jpg", - "quantity": "2" - }, - { - "product_id": "507f1f77bcf86cd7994390112", - "sku": "45790-322", - "name": "Monopoly: 3rd Edition2", - "price": "192", - "quantity": 22, - "position": "12", - "category": "Cars2", - "url": "https://www.example.com/product/path2", - "image_url": "https://www.example.com/product/path.jpg2" - } - ] - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - } - }, - ], - destType: 'google_adwords_enhanced_conversions', + { + name: 'google_adwords_enhanced_conversions', + description: 'Test 0', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', }, - method: 'POST', + jobId: 1, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, }, + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + jobId: 2, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + type: 'identify', + traits: { + status: 'elizabeth', + }, + userId: 'emrichardson820+22822@gmail.com', + channel: 'sources', + context: { + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + externalId: [ + { + id: 'emrichardson820+22822@gmail.com', + type: 'MAILCHIMP-92e1f1ad2c', + identifierType: 'email_address', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a', + messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82', + }, + }, + { + metadata: { + secret: {}, + jobId: 3, + }, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + phone: '912382193', + firstName: 'John', + lastName: 'Gomes', + city: 'London', + state: 'UK', + streetAddress: '71 Cherry Court SOUTHAMPTON SO53 5PD UK', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + event: 'Page View', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + originalTimestamp: '2019-10-14T11:15:18.299Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + adjustedValue: '10', + currency: 'INR', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + partialFailure: true, + campaignId: '1', + templateId: '0', + order_id: 10000, + total: 1000, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + ], + destType: 'google_adwords_enhanced_conversions', }, - output: { - response: { - status: 200, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '11', + }, + params: { event: 'Page View', customerId: '1234567890' }, body: { - output: [ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://googleads.googleapis.com/v14/customers/1234567890:uploadConversionAdjustments", - "headers": { - "Authorization": "Bearer abcd1234", - "Content-Type": "application/json", - "developer-token": "ijkl91011", - "login-customer-id": "11" - }, - "params": { "event": "Page View", "customerId": "1234567890" }, - "body": { - "JSON": { - "partialFailure": true, - "conversionAdjustments": [ - { - "gclidDateTimePair": { - "gclid": "gclid1234", - "conversionDateTime": "2022-01-01 12:32:45-08:00" - }, - "restatementValue": { - "adjustedValue": 10, - "currencyCode": "INR" - }, - "orderId": "10000", - "adjustmentDateTime": "2022-01-01 12:32:45-08:00", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "userIdentifiers": [ - { - "hashedPhoneNumber": "04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe" - }, - { - "addressInfo": { - "hashedFirstName": "a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da", - "hashedLastName": "1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4", - "state": "UK", - "city": "London", - "hashedStreetAddress": "9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550" - } - } - ], - "adjustmentType": "ENHANCEMENT" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - }, - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [{ "conversions": "Page View" }, { "conversions": "Product Added" }], - "authStatus": "active" - } - } + JSON: { + partialFailure: true, + conversionAdjustments: [ + { + gclidDateTimePair: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', }, - { - "metadata": [ - { - "secret": { - "access_token": "abcd1234", - "refresh_token": "efgh5678", - "developer_token": "ijkl91011" - }, - "jobId": 2 - } - ], - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } - }, - "batched": false, - "statusCode": 400, - "error": "Message Type identify is not supported. Aborting message.", - "statTags": { - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "feature": "router", - "implementation": "native", - "module": "destination", - } + restatementValue: { + adjustedValue: 10, + currencyCode: 'INR', }, - { - "metadata": [ - { - "secret": {}, - "jobId": 3 - } - ], - "destination": { - "Config": { - "rudderAccountId": "25u5whFH7gVTnCiAjn4ykoCLGoC", - "customerId": "1234567890", - "subAccount": true, - "loginCustomerId": "11", - "listOfConversions": [ - { - "conversions": "Page View" - }, - { - "conversions": "Product Added" - } - ], - "authStatus": "active" - } + orderId: '10000', + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + userIdentifiers: [ + { + hashedPhoneNumber: + '04387707e6cbed8c4538c81cc570ed9252d579469f36c273839b26d784e4bdbe', + }, + { + addressInfo: { + hashedFirstName: + 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', + hashedLastName: + '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', + state: 'UK', + city: 'London', + hashedStreetAddress: + '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', }, - "batched": false, - "statusCode": 500, - "error": "OAuth - access token not found", - "statTags": { - "destType": "GOOGLE_ADWORDS_ENHANCED_CONVERSIONS", - "errorCategory": "platform", - "errorType": "oAuthSecret", - "feature": "router", - "implementation": "native", - "module": "destination", - } - } - ] - , + }, + ], + adjustmentType: 'ENHANCEMENT', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + jobId: 1, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { conversions: 'Page View' }, + { conversions: 'Product Added' }, + ], + authStatus: 'active', + }, + }, + }, + { + metadata: [ + { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + jobId: 2, + }, + ], + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', + }, + }, + batched: false, + statusCode: 400, + error: 'Message Type identify is not supported. Aborting message.', + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + }, + { + metadata: [ + { + secret: {}, + jobId: 3, + }, + ], + destination: { + Config: { + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + customerId: '1234567890', + subAccount: true, + loginCustomerId: '11', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + authStatus: 'active', }, + }, + batched: false, + statusCode: 500, + error: 'OAuth - access token not found', + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + errorCategory: 'platform', + errorType: 'oAuthSecret', + feature: 'router', + implementation: 'native', + module: 'destination', + }, }, + ], }, - } + }, + }, + }, ]; From 74a2be7c122662541ced49dcbf5f47baa0c6b0da Mon Sep 17 00:00:00 2001 From: shrouti1507 Date: Thu, 4 Jan 2024 10:52:10 +0530 Subject: [PATCH 2/2] fix: added metadata.jobId to jobId of the payload --- .../data/trackConfig.json | 8 -------- .../google_adwords_enhanced_conversions/transform.js | 2 ++ .../google_adwords_enhanced_conversions/processor/data.ts | 1 - .../google_adwords_enhanced_conversions/router/data.ts | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json b/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json index d98b71eb5d..562a77f0e8 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json +++ b/src/v0/destinations/google_adwords_enhanced_conversions/data/trackConfig.json @@ -129,13 +129,5 @@ "metadata": { "type": "hashToSha256" } - }, - { - "destKey": "jobId", - "sourceKeys": ["properties.jobId"], - "required": false, - "metadata": { - "type": "toInt" - } } ] diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js index 0be7c3f0ee..cf5bf8afa8 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js @@ -77,6 +77,8 @@ const processTrackEvent = async (metadata, message, destination) => { const payload = constructPayload(message, updatedMapping); payload.partialFailure = true; + // ref: https://developers.google.com/google-ads/api/docs/release-notes#:~:text=Added%20job_id%20as,UploadConversionAdjustmentsRequest + payload.jobId = metadata.jobId; if (!payload.conversionAdjustments[0]?.userIdentifiers) { throw new InstrumentationError( `Any of email, phone, firstName, lastName, city, street, countryCode, postalCode or streetAddress is required in traits.`, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts index 1032b3b13c..ba6aa5f1e4 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1566,7 +1566,6 @@ export const data = [ adjustmentType: 'ENHANCEMENT', }, ], - jobId: 1, partialFailure: true, }, JSON_ARRAY: {}, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index 4153630323..68ed5454cf 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -304,6 +304,7 @@ export const data = [ params: { event: 'Page View', customerId: '1234567890' }, body: { JSON: { + jobId: 1, partialFailure: true, conversionAdjustments: [ {