diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/config.js b/src/v0/destinations/google_adwords_enhanced_conversions/config.js index e8f486fb7a..8a3f8ab673 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/config.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/config.js @@ -1,6 +1,8 @@ const { getMappingConfig } = require('../../util'); -const BASE_ENDPOINT = 'https://googleads.googleapis.com/v15/customers'; +const API_VERSION = 'v17'; + +const BASE_ENDPOINT = 'https://googleads.googleapis.com/v17/customers'; const CONFIG_CATEGORIES = { TRACK_CONFIG: { type: 'track', name: 'trackConfig' }, @@ -17,4 +19,5 @@ module.exports = { hashAttributes, CONVERSION_ACTION_ID_CACHE_TTL, destType: 'google_adwords_enhanced_conversions', + API_VERSION, }; diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts index 0cee1418e1..a5bbaa05c5 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts @@ -4,6 +4,7 @@ import { generateProxyV1Payload, } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; const headers = { Authorization: 'Bearer abcd1234', @@ -82,8 +83,7 @@ export const testScenariosForV0API = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567899:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567899:uploadConversionAdjustments`, }), method: 'POST', }, @@ -138,8 +138,7 @@ export const testScenariosForV0API = [ customerId: '1234567888', destination: 'google_adwords_enhanced_conversions', }, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567888:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567888:uploadConversionAdjustments`, }), method: 'POST', }, @@ -203,8 +202,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567899:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567899:uploadConversionAdjustments`, }, [generateMetadata(1)], ), @@ -251,8 +249,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ customerId: '1234567888', destination: 'google_adwords_enhanced_conversions', }, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567888:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567888:uploadConversionAdjustments`, }, [generateMetadata(1)], ), diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts index 70d9eeaf33..c6e29925dd 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts @@ -1,4 +1,4 @@ -import { ProxyV1TestData } from '../../../testTypes'; +import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; import { generateProxyV1Payload, generateProxyV0Payload, @@ -83,8 +83,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, }), method: 'POST', }, @@ -137,8 +136,7 @@ export const v0oauthScenarios = [ customerId: '1234567910', destination: 'google_adwords_enhanced_conversions', }, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567910/googleAds:searchStream', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567910/googleAds:searchStream`, }), method: 'POST', }, @@ -192,8 +190,7 @@ export const v1oauthScenarios = [ request: { body: generateProxyV1Payload({ ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, }), method: 'POST', }, @@ -244,8 +241,7 @@ export const v1oauthScenarios = [ customerId: '1234567910', destination: 'google_adwords_enhanced_conversions', }, - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567910/googleAds:searchStream', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567910/googleAds:searchStream`, }), method: 'POST', }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts index 69b3a6103a..270ec2dc77 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts @@ -1,7 +1,8 @@ +import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; export const networkCallsData = [ { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567890/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, @@ -29,7 +30,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567899/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567899/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, @@ -59,7 +60,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567899:uploadConversionAdjustments', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567899:uploadConversionAdjustments`, data: { conversionAdjustments: [ { @@ -123,7 +124,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567891/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, @@ -153,7 +154,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadConversionAdjustments', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadConversionAdjustments`, data: { conversionAdjustments: [ { @@ -214,7 +215,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, data: { conversionAdjustments: [ { @@ -275,7 +276,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567888/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567888/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, @@ -305,7 +306,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567888:uploadConversionAdjustments', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567888:uploadConversionAdjustments`, data: { conversionAdjustments: [ { @@ -382,7 +383,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v15/customers/1234567910/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567910/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, 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 13b2609bf8..40d8370fcb 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1,3 +1,4 @@ +import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; export const data = [ { name: 'google_adwords_enhanced_conversions', @@ -128,8 +129,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -616,8 +616,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1328,8 +1327,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1519,8 +1517,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', 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 dff0f772d3..1d77b5d774 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -1,3 +1,5 @@ +import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; + const events = [ { metadata: { @@ -357,8 +359,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v15/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json',