Skip to content

Commit

Permalink
fix: updating API version to v16
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Mar 11, 2024
1 parent f6a30da commit 3d4634e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { getMappingConfig } = require('../../util');

const API_VERSION = 'v15';
const API_VERSION = 'v16';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,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/v15/customers/9625812972:uploadClickConversions',
endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions',
payload: {
conversions: [
{
Expand Down Expand Up @@ -192,7 +192,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
delete fittingPayload.traits.email;
delete fittingPayload.properties.email;
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v15/customers/9625812972:uploadClickConversions',
endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions',
payload: {
conversions: [
{
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
delete fittingPayload.traits.phone;
delete fittingPayload.properties.email;
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v15/customers/9625812972:uploadClickConversions',
endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions',
payload: {
conversions: [
{
Expand All @@ -246,7 +246,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
).toThrow('Either of email or phone is required for user identifier');
});

it('getClickConversionPayloadAndEndpoint flow check when default field identifier is present and product list present', () => {
it('populateConsentForGAOC', () => {
let fittingPayload = { ...getTestMessage() };
fittingPayload.properties.products = [
{
Expand All @@ -260,7 +260,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => {
},
];
let expectedOutput = {
endpoint: 'https://googleads.googleapis.com/v15/customers/9625812972:uploadClickConversions',
endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions',
payload: {
conversions: [
{
Expand Down
14 changes: 7 additions & 7 deletions src/v0/util/googleUtils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const UNKNOWN_CONSENT = 'UNKNOWN';
*
* @param {object} properties - message.properties containing properties related to consent.
* @returns {object} - An object containing consent information.
* ref : https://developers.google.com/google-ads/api/rest/reference/rest/v15/Consent
* ref : https://developers.google.com/google-ads/api/rest/reference/rest/v16/Consent
*/

const populateConsentFromConfig = (config) => {
Expand Down Expand Up @@ -45,14 +45,14 @@ const populateConsentFromConfig = (config) => {
* @returns {object} - An object containing consent information.
* * ref :
* 1) For click conversion :
* a) https://developers.google.com/google-ads/api/rest/reference/rest/v15/customers/uploadClickConversions#ClickConversion
* b) https://developers.google.com/google-ads/api/reference/rpc/v15/ClickConversion#consent
* a) https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/uploadClickConversions#ClickConversion
* b) https://developers.google.com/google-ads/api/reference/rpc/v16/ClickConversion#consent
* 2) For Call conversion :
* a) https://developers.google.com/google-ads/api/rest/reference/rest/v15/customers/uploadCallConversions#CallConversion
* b) https://developers.google.com/google-ads/api/reference/rpc/v15/CallConversion#consent
* a) https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/uploadCallConversions#CallConversion
* b) https://developers.google.com/google-ads/api/reference/rpc/v16/CallConversion#consent
* 3) For Store sales conversion :
* a) https://developers.google.com/google-ads/api/reference/rpc/v15/UserData
* b) https://developers.google.com/google-ads/api/reference/rpc/v15/UserData#consent
* a) https://developers.google.com/google-ads/api/reference/rpc/v16/UserData
* b) https://developers.google.com/google-ads/api/reference/rpc/v16/UserData#consent
*/

const populateConsentForGAOC = (message, conversionType, destConfig) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v15/customers/11122233331/offlineUserDataJobs',
'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -91,7 +91,7 @@ export const data = [
code: 400,
details: [
{
'@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure',
'@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure',
errors: [
{
errorCode: {
Expand Down Expand Up @@ -152,7 +152,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://googleads.googleapis.com/v15/customers/1112223333/offlineUserDataJobs',
endpoint: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -248,7 +248,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://googleads.googleapis.com/v15/customers/customerid/offlineUserDataJobs',
endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -358,7 +358,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v15/customers/1234567890:uploadClickConversions',
'https://googleads.googleapis.com/v16/customers/1234567890:uploadClickConversions',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -505,7 +505,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions',
'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -646,7 +646,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions',
'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions',
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const networkCallsData = [
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/11122233331/offlineUserDataJobs:create',
url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs:create',
data: {
job: {
storeSalesMetadata: {
Expand Down Expand Up @@ -30,7 +30,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1112223333/googleAds:searchStream',
url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream',
data: {
query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`,
},
Expand Down Expand Up @@ -63,7 +63,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations',
url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations',
data: {
enable_partial_failure: false,
enable_warnings: false,
Expand Down Expand Up @@ -108,7 +108,7 @@ export const networkCallsData = [
status: 'INVALID_ARGUMENT',
details: [
{
'@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure',
'@type': 'type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure',
errors: [
{
errorCode: {
Expand Down Expand Up @@ -144,7 +144,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1112223333/offlineUserDataJobs:create',
url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs:create',
data: {
job: {
storeSalesMetadata: {
Expand Down Expand Up @@ -173,7 +173,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations',
url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations',
data: {
enable_partial_failure: false,
enable_warnings: false,
Expand Down Expand Up @@ -216,7 +216,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run',
url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run',
data: { validate_only: false },
params: { destination: 'google_adwords_offline_conversion' },
headers: {
Expand All @@ -236,7 +236,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/customerid/offlineUserDataJobs:create',
url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create',
data: {
job: {
storeSalesMetadata: {
Expand Down Expand Up @@ -270,7 +270,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1234567890/googleAds:searchStream',
url: 'https://googleads.googleapis.com/v16/customers/1234567890/googleAds:searchStream',
data: {
query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`,
},
Expand Down Expand Up @@ -298,7 +298,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1234567891/googleAds:searchStream',
url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream',
data: {
query:
"SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'",
Expand Down Expand Up @@ -331,7 +331,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1234567891/googleAds:searchStream',
url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream',
data: { query: 'SELECT conversion_custom_variable.name FROM conversion_custom_variable' },
headers: {
Authorization: 'Bearer abcd1234',
Expand Down Expand Up @@ -365,7 +365,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions',
url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions',
data: {
conversions: [
{
Expand Down Expand Up @@ -432,7 +432,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/1234567891:uploadClickConversions',
url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions',
data: {
conversions: [
{
Expand Down
Loading

0 comments on commit 3d4634e

Please sign in to comment.