diff --git a/CHANGELOG.md b/CHANGELOG.md index bcfd6f2835..8c7591edec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.83.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.83.1...v1.83.2) (2024-11-05) + + +### Bug Fixes + +* update gaec destination with config validation ([#3847](https://github.com/rudderlabs/rudder-transformer/issues/3847)) ([e5c5b0a](https://github.com/rudderlabs/rudder-transformer/commit/e5c5b0a28070ff5ca89a274c3998b96780139149)) + +### [1.83.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.83.0...v1.83.1) (2024-11-01) + ## [1.83.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.82.2...v1.83.0) (2024-10-25) diff --git a/package-lock.json b/package-lock.json index 4d1f190211..0965688626 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.83.0", + "version": "1.83.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.83.0", + "version": "1.83.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 255dbb98b6..65b7313e88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.83.0", + "version": "1.83.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { diff --git a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml index 5d97da5a9e..64d391c888 100644 --- a/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml +++ b/src/cdk/v2/destinations/pinterest_tag/procWorkflow.yaml @@ -167,11 +167,7 @@ steps: "content_ids": (props.product_id ?? props.sku ?? props.id)[], "contents": { "quantity": Number(props.quantity) || 1, - "item_price": String(props.price), - "item_name": String(props.name), - "id": props.product_id ?? props.sku, - "item_category": props.category, - "item_brand": props.brand + "item_price": String(props.price) }[] }; - name: combineAllEcomFields diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js index 13a294ea95..497d4f294f 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/transform.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/transform.js @@ -56,13 +56,11 @@ const responseBuilder = async (metadata, message, { Config }, payload) => { if (isNumber(customerId)) { customerId = customerId.toString(); } - if (isNumber(loginCustomerId)) { - loginCustomerId = loginCustomerId.toString(); - } - if (!isString(customerId) || !isString(loginCustomerId)) { - throw new InstrumentationError('customerId and loginCustomerId should be a string or number'); + if (!isString(customerId)) { + throw new InstrumentationError('customerId should be a string or number'); } const filteredCustomerId = removeHyphens(customerId); + response.endpoint = `${BASE_ENDPOINT}/${filteredCustomerId}:uploadConversionAdjustments`; response.body.JSON = payload; const accessToken = getAccessToken(metadata, 'access_token'); @@ -72,11 +70,19 @@ const responseBuilder = async (metadata, message, { Config }, payload) => { 'developer-token': getValueFromMessage(metadata, 'secret.developer_token'), }; response.params = { event, customerId: filteredCustomerId }; - if (subAccount) - if (loginCustomerId) { - const filteredLoginCustomerId = removeHyphens(loginCustomerId); - response.headers['login-customer-id'] = filteredLoginCustomerId; - } else throw new ConfigurationError(`LoginCustomerId is required as subAccount is true.`); + if (subAccount) { + if (!loginCustomerId) { + throw new ConfigurationError(`loginCustomerId is required as subAccount is true.`); + } + if (isNumber(loginCustomerId)) { + loginCustomerId = loginCustomerId.toString(); + } + if (loginCustomerId && !isString(loginCustomerId)) { + throw new InstrumentationError('loginCustomerId should be a string or number'); + } + const filteredLoginCustomerId = removeHyphens(loginCustomerId); + response.headers['login-customer-id'] = filteredLoginCustomerId; + } if (loginCustomerId) { const filteredLoginCustomerId = removeHyphens(loginCustomerId); diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index eaf8b79d54..0b05b6f2d6 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -977,6 +977,7 @@ describe('removeHyphens', () => { { input: null, expected: null }, { input: undefined, expected: undefined }, { input: 12345, expected: 12345 }, + { input: '123-12-241', expected: '12312241' }, ]; it('should remove hyphens from string else return the input as it is', () => { data.forEach(({ input, expected }) => { diff --git a/test/apitests/data_scenarios/cdk_v2/failure.json b/test/apitests/data_scenarios/cdk_v2/failure.json index 154d24481d..1635a3f0db 100644 --- a/test/apitests/data_scenarios/cdk_v2/failure.json +++ b/test/apitests/data_scenarios/cdk_v2/failure.json @@ -556,10 +556,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -683,10 +679,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } diff --git a/test/apitests/data_scenarios/cdk_v2/success.json b/test/apitests/data_scenarios/cdk_v2/success.json index 88f430dd7c..ced7433a28 100644 --- a/test/apitests/data_scenarios/cdk_v2/success.json +++ b/test/apitests/data_scenarios/cdk_v2/success.json @@ -556,10 +556,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -638,10 +634,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -720,10 +712,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } diff --git a/test/apitests/data_scenarios/destination/proc/batch_input_multiplex.json b/test/apitests/data_scenarios/destination/proc/batch_input_multiplex.json index 3deb7d4b8b..3ce7c15091 100644 --- a/test/apitests/data_scenarios/destination/proc/batch_input_multiplex.json +++ b/test/apitests/data_scenarios/destination/proc/batch_input_multiplex.json @@ -388,10 +388,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -470,10 +466,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -552,10 +544,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } diff --git a/test/apitests/data_scenarios/destination/proc/multiplex_partial_failure.json b/test/apitests/data_scenarios/destination/proc/multiplex_partial_failure.json index a2652855d5..0e467c26d0 100644 --- a/test/apitests/data_scenarios/destination/proc/multiplex_partial_failure.json +++ b/test/apitests/data_scenarios/destination/proc/multiplex_partial_failure.json @@ -388,10 +388,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -470,10 +466,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } diff --git a/test/apitests/data_scenarios/destination/proc/multiplex_success.json b/test/apitests/data_scenarios/destination/proc/multiplex_success.json index ba4d5266f3..66b6c870a9 100644 --- a/test/apitests/data_scenarios/destination/proc/multiplex_success.json +++ b/test/apitests/data_scenarios/destination/proc/multiplex_success.json @@ -207,10 +207,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -289,10 +285,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } diff --git a/test/apitests/data_scenarios/destination/router/failure_test.json b/test/apitests/data_scenarios/destination/router/failure_test.json index 197456f66a..9e36da50cb 100644 --- a/test/apitests/data_scenarios/destination/router/failure_test.json +++ b/test/apitests/data_scenarios/destination/router/failure_test.json @@ -754,10 +754,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } @@ -785,10 +781,6 @@ "content_ids": ["123"], "contents": [ { - "id": "123", - "item_brand": "Gamepro", - "item_category": "Games", - "item_name": "Game", "quantity": 11, "item_price": "13.49" } 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 87fad8b9a5..fcdb6f15ca 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -814,7 +814,7 @@ export const data = [ }, }, statusCode: 400, - error: 'LoginCustomerId is required as subAccount is true.', + error: 'loginCustomerId is required as subAccount is true.', statTags: { errorCategory: 'dataValidation', errorType: 'configuration', 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 33cb4a832f..b319a8cb3b 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -427,6 +427,8 @@ const events = [ Config: { rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', configData: '{"customerId":"1234567890", "loginCustomerId":"65656565"}', + customerId: '1234567890', + subAccount: true, listOfConversions: [{ conversions: 'Page View' }, { conversions: 'Product Added' }], authStatus: 'active', }, @@ -452,11 +454,17 @@ const events = [ 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 }, + customerID: {}, + subaccountID: 11, }, 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', @@ -496,6 +504,43 @@ const events = [ }, integrations: { All: true }, name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + }, + { + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + jobId: 7, + userId: 'u1', + }, + destination: { + Config: { + customerId: '1234567890', + subAccount: true, + loginCustomerId: { id: '1234567890' }, + listOfConversions: [{ conversions: 'Page View' }, { conversions: 'Product Added' }], + authStatus: 'active', + }, + }, + message: { + event: 'Page View', + type: 'track', + userId: '12345', + context: { + traits: { + email: 'user@testmail.com', + }, + }, + properties: { + gclid: 'gclid1234', + conversionDateTime: '2022-01-01 12:32:45-08:00', + order_id: 10000, + total: 1000, + }, }, }, ]; @@ -628,30 +673,24 @@ export const data = [ body: { output: [ { + batched: false, batchedRequest: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://googleads.googleapis.com/${API_VERSION}/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: { + FORM: {}, JSON: { - partialFailure: true, conversionAdjustments: [ { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', gclidDateTimePair: { - gclid: 'gclid1234', conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - restatementValue: { adjustedValue: 10, currencyCode: 'INR' }, orderId: '10000', - adjustmentDateTime: '2022-01-01 12:32:45-08:00', + restatementValue: { + adjustedValue: 10, + currencyCode: '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: [ @@ -661,82 +700,102 @@ export const data = [ }, { addressInfo: { + city: 'London', hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + state: 'UK', }, }, ], - adjustmentType: 'ENHANCEMENT', }, ], + partialFailure: true, }, JSON_ARRAY: {}, XML: {}, - FORM: {}, }, + endpoint: + 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', files: {}, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '11', + }, + method: 'POST', + params: { + customerId: '1234567890', + event: 'Page View', + }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + authStatus: 'active', + customerId: '1234567890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + loginCustomerId: '11', + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, + }, }, metadata: [ { + jobId: 1, secret: { access_token: 'abcd1234', - refresh_token: 'efgh5678', developer_token: 'ijkl91011', + refresh_token: 'efgh5678', }, - jobId: 1, userId: 'u1', }, ], - batched: false, statusCode: 200, + }, + { + batched: false, destination: { Config: { - rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + authStatus: 'active', customerId: '1234567890', - subAccount: true, - loginCustomerId: '11', listOfConversions: [ - { conversions: 'Page View' }, - { conversions: 'Product Added' }, + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, ], - authStatus: 'active', + loginCustomerId: '', + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, }, }, - }, - { + error: 'Message Type identify is not supported. Aborting message.', metadata: [ { + jobId: 2, secret: { access_token: 'abcd1234', - refresh_token: 'efgh5678', developer_token: 'ijkl91011', + refresh_token: 'efgh5678', }, - jobId: 2, userId: 'u1', }, ], - 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', @@ -745,25 +804,35 @@ export const data = [ implementation: 'native', module: 'destination', }, + statusCode: 400, }, { - metadata: [{ secret: {}, jobId: 3, userId: 'u1' }], + batched: false, destination: { Config: { - rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + authStatus: 'active', customerId: '1234567890', - subAccount: true, - loginCustomerId: '11', listOfConversions: [ - { conversions: 'Page View' }, - { conversions: 'Product Added' }, + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, ], - authStatus: 'active', + loginCustomerId: '11', + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, }, }, - batched: false, - statusCode: 500, error: 'OAuth - access token not found', + metadata: [ + { + jobId: 3, + secret: {}, + userId: 'u1', + }, + ], statTags: { destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', errorCategory: 'platform', @@ -772,32 +841,27 @@ export const data = [ implementation: 'native', module: 'destination', }, + statusCode: 500, }, { + batched: false, batchedRequest: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://googleads.googleapis.com/${API_VERSION}/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: { + FORM: {}, JSON: { - partialFailure: true, conversionAdjustments: [ { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', gclidDateTimePair: { - gclid: 'gclid1234', conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - restatementValue: { adjustedValue: 10, currencyCode: 'INR' }, orderId: '10000', - adjustmentDateTime: '2022-01-01 12:32:45-08:00', + restatementValue: { + adjustedValue: 10, + currencyCode: '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: [ @@ -807,116 +871,131 @@ export const data = [ }, { addressInfo: { + city: 'London', hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + state: 'UK', }, }, ], - adjustmentType: 'ENHANCEMENT', }, ], + partialFailure: true, }, JSON_ARRAY: {}, XML: {}, - FORM: {}, }, + endpoint: + 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', files: {}, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '11', + }, + method: 'POST', + params: { + customerId: '1234567890', + event: 'Page View', + }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + authStatus: 'active', + customerId: 1234567890, + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + loginCustomerId: 11, + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, + }, }, metadata: [ { + jobId: 4, secret: { access_token: 'abcd1234', - refresh_token: 'efgh5678', developer_token: 'ijkl91011', + refresh_token: 'efgh5678', }, - jobId: 4, userId: 'u1', }, ], - batched: false, statusCode: 200, + }, + { + batched: false, destination: { Config: { - rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', - customerId: 1234567890, - subAccount: true, - loginCustomerId: 11, + authStatus: 'active', + customerId: {}, listOfConversions: [ - { conversions: 'Page View' }, - { conversions: 'Product Added' }, + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, ], - authStatus: 'active', + loginCustomerId: 11, + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, }, }, - }, - { - batched: false, - statusCode: 400, - error: 'customerId and loginCustomerId should be a string or number', - statTags: { - destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'router', - implementation: 'native', - module: 'destination', - }, + error: 'customerId should be a string or number', metadata: [ { + jobId: 5, secret: { access_token: 'abcd1234', - refresh_token: 'efgh5678', developer_token: 'ijkl91011', + refresh_token: 'efgh5678', }, - jobId: 5, userId: 'u1', }, ], - destination: { - Config: { - rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', - customerId: {}, - subAccount: true, - loginCustomerId: 11, - listOfConversions: [ - { conversions: 'Page View' }, - { conversions: 'Product Added' }, - ], - authStatus: 'active', - }, + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', }, + statusCode: 400, }, { + batched: false, batchedRequest: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': '65656565', - }, - params: { event: 'Page View', customerId: '1234567890' }, body: { + FORM: {}, JSON: { - partialFailure: true, conversionAdjustments: [ { + adjustmentDateTime: '2022-01-01 12:32:45-08:00', + adjustmentType: 'ENHANCEMENT', gclidDateTimePair: { - gclid: 'gclid1234', conversionDateTime: '2022-01-01 12:32:45-08:00', + gclid: 'gclid1234', }, - restatementValue: { adjustedValue: 10, currencyCode: 'INR' }, orderId: '10000', - adjustmentDateTime: '2022-01-01 12:32:45-08:00', + restatementValue: { + adjustedValue: 10, + currencyCode: '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: [ @@ -926,51 +1005,112 @@ export const data = [ }, { addressInfo: { + city: 'London', hashedFirstName: 'a8cfcd74832004951b4408cdb0a5dbcd8c7e52d43f7fe244bf720582e05241da', hashedLastName: '1c574b17eefa532b6d61c963550a82d2d3dfca4a7fb69e183374cfafd5328ee4', - state: 'UK', - city: 'London', hashedStreetAddress: '9a4d2e50828448f137f119a3ebdbbbab8d6731234a67595fdbfeb2a2315dd550', + state: 'UK', }, }, ], - adjustmentType: 'ENHANCEMENT', }, ], + partialFailure: true, }, JSON_ARRAY: {}, XML: {}, - FORM: {}, }, + endpoint: + 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', files: {}, + headers: { + Authorization: 'Bearer abcd1234', + 'Content-Type': 'application/json', + 'developer-token': 'ijkl91011', + 'login-customer-id': '65656565', + }, + method: 'POST', + params: { + customerId: '1234567890', + event: 'Page View', + }, + type: 'REST', + version: '1', + }, + destination: { + Config: { + authStatus: 'active', + configData: '{"customerId":"1234567890", "loginCustomerId":"65656565"}', + customerId: '1234567890', + listOfConversions: [ + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, + ], + rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + subAccount: true, + }, }, metadata: [ { + jobId: 6, secret: { access_token: 'abcd1234', - refresh_token: 'efgh5678', developer_token: 'ijkl91011', + refresh_token: 'efgh5678', }, - jobId: 6, userId: 'u1', }, ], - batched: false, statusCode: 200, + }, + { + batched: false, destination: { Config: { - configData: '{"customerId":"1234567890", "loginCustomerId":"65656565"}', - rudderAccountId: '25u5whFH7gVTnCiAjn4ykoCLGoC', + authStatus: 'active', + customerId: '1234567890', listOfConversions: [ - { conversions: 'Page View' }, - { conversions: 'Product Added' }, + { + conversions: 'Page View', + }, + { + conversions: 'Product Added', + }, ], - authStatus: 'active', + loginCustomerId: { + id: '1234567890', + }, + subAccount: true, + }, + }, + error: 'loginCustomerId should be a string or number', + metadata: [ + { + jobId: 7, + secret: { + access_token: 'abcd1234', + developer_token: 'ijkl91011', + refresh_token: 'efgh5678', + }, + userId: 'u1', }, + ], + statTags: { + destType: 'GOOGLE_ADWORDS_ENHANCED_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', }, + statusCode: 400, }, ], }, diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts index 1788d13d56..b856d247d7 100644 --- a/test/integrations/destinations/pinterest_tag/processor/data.ts +++ b/test/integrations/destinations/pinterest_tag/processor/data.ts @@ -482,9 +482,7 @@ export const data = [ order_id: '50314b8e9bcf000000000000', num_items: 2, content_ids: ['123'], - contents: [ - { id: '123', item_name: 'undefined', quantity: 2, item_price: '25' }, - ], + contents: [{ quantity: 2, item_price: '25' }], }, }, JSON_ARRAY: {}, @@ -2407,9 +2405,7 @@ export const data = [ order_id: '50314b8e9bcf000000000000', num_items: 0, content_ids: ['1234'], - contents: [ - { id: '1234', item_name: 'undefined', quantity: 1, item_price: 'undefined' }, - ], + contents: [{ quantity: 1, item_price: 'undefined' }], }, }, JSON_ARRAY: {}, @@ -2670,7 +2666,7 @@ export const data = [ advertiser_id: '123456', app_id: '429047995', custom_data: { - contents: [{ item_price: 'undefined', quantity: 1, item_name: 'undefined' }], + contents: [{ item_price: 'undefined', quantity: 1 }], currency: 'USD', num_items: 0, order_id: '50314b8e9bcf000000000000', @@ -3501,7 +3497,6 @@ export const data = [ subtotal: 22.5, affiliation: 'Google Store', checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', - category: 'Apparel', }, anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', integrations: { All: true }, @@ -3568,8 +3563,6 @@ export const data = [ { quantity: 1, item_price: 'undefined', - item_name: 'undefined', - item_category: 'Apparel', }, ], currency: 'USD', diff --git a/test/integrations/destinations/pinterest_tag/router/data.ts b/test/integrations/destinations/pinterest_tag/router/data.ts index 28c82c4679..c9ab29a45a 100644 --- a/test/integrations/destinations/pinterest_tag/router/data.ts +++ b/test/integrations/destinations/pinterest_tag/router/data.ts @@ -815,9 +815,7 @@ export const data = [ order_id: '50314b8e9bcf000000000000', num_items: 2, content_ids: ['123'], - contents: [ - { id: '123', item_name: 'undefined', quantity: 2, item_price: '25' }, - ], + contents: [{ quantity: 2, item_price: '25' }], }, }, { diff --git a/test/integrations/destinations/pinterest_tag/step/data.ts b/test/integrations/destinations/pinterest_tag/step/data.ts index 8f0680a77c..b607e3c9fa 100644 --- a/test/integrations/destinations/pinterest_tag/step/data.ts +++ b/test/integrations/destinations/pinterest_tag/step/data.ts @@ -468,9 +468,7 @@ export const data = [ order_id: '50314b8e9bcf000000000000', num_items: 2, content_ids: ['123'], - contents: [ - { id: '123', item_name: 'undefined', quantity: 2, item_price: '25' }, - ], + contents: [{ quantity: 2, item_price: '25' }], }, }, JSON_ARRAY: {}, @@ -2422,9 +2420,7 @@ export const data = [ order_id: '50314b8e9bcf000000000000', num_items: 0, content_ids: ['1234'], - contents: [ - { id: '1234', item_name: 'undefined', quantity: 1, item_price: 'undefined' }, - ], + contents: [{ quantity: 1, item_price: 'undefined' }], }, }, JSON_ARRAY: {}, @@ -2689,7 +2685,7 @@ export const data = [ advertiser_id: '123456', app_id: '429047995', custom_data: { - contents: [{ item_name: 'undefined', item_price: 'undefined', quantity: 1 }], + contents: [{ item_price: 'undefined', quantity: 1 }], currency: 'USD', num_items: 0, order_id: '50314b8e9bcf000000000000', @@ -3609,7 +3605,6 @@ export const data = [ num_items: 0, contents: [ { - item_name: 'undefined', quantity: 1, item_price: 'undefined', },