Skip to content

Commit

Permalink
chore: update google ads api version from 17 to 18 (#4084)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Feb 20, 2025
1 parent 58738ba commit fb5bedc
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 118 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { getMappingConfig } = require('../../util');

const API_VERSION = 'v17';
const API_VERSION = 'v18';

const BASE_ENDPOINT = 'https://googleads.googleapis.com/v17/customers';
const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`;

const CONFIG_CATEGORIES = {
TRACK_CONFIG: { type: 'track', name: 'trackConfig' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { getMappingConfig } = require('../../util');

const API_VERSION = 'v17';
const API_VERSION = 'v18';

const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers/:customerId`;

Expand Down Expand Up @@ -65,4 +65,5 @@ module.exports = {
trackAddStoreAddressConversionsMapping:
MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_ADDRESS_IDENTIFIER.name],
consentConfigMap,
API_VERSION,
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const {
getCallConversionPayload,
} = require('./utils');

const API_VERSION = 'v18';

const getTestMessage = () => {
let message = {
event: 'testEventName',
Expand Down Expand Up @@ -163,7 +165,7 @@ describe('getExisitingUserIdentifier util tests', () => {
describe('getClickConversionPayloadAndEndpoint util tests', () => {
it('getClickConversionPayloadAndEndpoint flow check when default field identifier is present', () => {
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`,
payload: {
conversions: [
{
Expand Down Expand Up @@ -193,7 +195,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
delete fittingPayload.traits.email;
delete fittingPayload.properties.email;
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`,
payload: {
conversions: [
{
Expand Down Expand Up @@ -225,7 +227,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
delete fittingPayload.traits.phone;
delete fittingPayload.properties.email;
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`,
payload: {
conversions: [
{
Expand Down Expand Up @@ -263,7 +265,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
},
];
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`,
payload: {
conversions: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { getMappingConfig } = require('../../util');

const API_VERSION = 'v17';
const API_VERSION = 'v18';

const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`;
const CONFIG_CATEGORIES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
generateProxyV1Payload,
} from '../../../testUtils';
import { ProxyV1TestData } from '../../../testTypes';
import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config';

const API_VERSION = 'v18';

const headers = {
Authorization: 'Bearer abcd1234',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config';
const API_VERSION = 'v18';

import {
generateProxyV1Payload,
generateProxyV0Payload,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_enhanced_conversions/config';
const API_VERSION = 'v18';

export const networkCallsData = [
{
httpReq: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config';
const API_VERSION = 'v18';
export const data = [
{
name: 'google_adwords_enhanced_conversions',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const API_VERSION = 'v18';

const events = [
{
metadata: {
Expand Down Expand Up @@ -657,8 +659,7 @@ export const data = [
JSON_ARRAY: {},
XML: {},
},
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`,
files: {},
headers: {
Authorization: 'Bearer abcd1234',
Expand Down Expand Up @@ -828,8 +829,7 @@ export const data = [
JSON_ARRAY: {},
XML: {},
},
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`,
files: {},
headers: {
Authorization: 'Bearer abcd1234',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
generateProxyV1Payload,
} from '../../../testUtils';

const API_VERSION = 'v18';

const transactionAttribute = {
CUSTOM_KEY: 'CUSTOM_VALUE',
currency_code: 'INR',
Expand Down Expand Up @@ -234,8 +236,7 @@ export const testScenariosForV0API = [
headers: headers.header1,
params: params.param1,
JSON: invalidArgumentRequestPayload,
endpoint:
'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -309,7 +310,7 @@ export const testScenariosForV0API = [
headers: headers.header1,
params: params.param1,
JSON: validRequestPayload1,
endpoint: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -349,8 +350,7 @@ export const testScenariosForV0API = [
headers: headers.header2,
params: params.param2,
JSON: validRequestPayload2,
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -399,8 +399,7 @@ export const testScenariosForV0API = [
headers: headers.header2,
params: params.param3,
JSON: validRequestPayload2,
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -452,8 +451,7 @@ export const testScenariosForV1API = [
headers: headers.header1,
params: params.param1,
JSON: invalidArgumentRequestPayload,
endpoint:
'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -499,8 +497,7 @@ export const testScenariosForV1API = [
headers: headers.header1,
params: params.param1,
JSON: validRequestPayload1,
endpoint:
'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -544,8 +541,7 @@ export const testScenariosForV1API = [
headers: headers.header2,
params: params.param2,
JSON: validRequestPayload2,
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`,
},
metadataArray,
),
Expand Down Expand Up @@ -590,8 +586,7 @@ export const testScenariosForV1API = [
headers: headers.header2,
params: params.param3,
JSON: validRequestPayload2,
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`,
},
metadataArray,
),
Expand Down Expand Up @@ -636,8 +631,7 @@ export const testScenariosForV1API = [
headers: headers.header2,
params: params.param4,
JSON: notAllowedToAccessFeatureRequestPayload,
endpoint:
'https://googleads.googleapis.com/v17/customers/1234567893:uploadClickConversions',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893:uploadClickConversions`,
},
metadataArray,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
generateProxyV0Payload,
} from '../../../testUtils';

const API_VERSION = 'v18';

const commonHeaders = {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -95,7 +97,7 @@ export const v0oauthScenarios = [
request: {
body: generateProxyV0Payload({
...commonRequestParameters,
endpoint: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -138,7 +140,7 @@ export const v0oauthScenarios = [
request: {
body: generateProxyV0Payload({
...commonRequestParameters,
endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -183,8 +185,7 @@ export const v1oauthScenarios = [
body: generateProxyV1Payload(
{
...commonRequestParameters,
endpoint:
'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -230,7 +231,7 @@ export const v1oauthScenarios = [
body: generateProxyV1Payload(
{
...commonRequestParameters,
endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -281,8 +282,7 @@ export const v1oauthScenarios = [
'developer-token': 'ijkl91011',
'login-customer-id': 'logincustomerid',
},
endpoint:
'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -353,8 +353,7 @@ export const v1oauthScenarios = [
'developer-token': 'ijkl91011',
'login-customer-id': 'logincustomerid',
},
endpoint:
'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down
Loading

0 comments on commit fb5bedc

Please sign in to comment.