From 36ed4cf800c1fd0e3df4e807faaa1fdb863df5e4 Mon Sep 17 00:00:00 2001 From: towfiqi Date: Sun, 23 Feb 2025 22:27:59 +0600 Subject: [PATCH] fix: Resolves AdWords integration issue. --- utils/adwords.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/adwords.ts b/utils/adwords.ts index 21108d8..fba853e 100644 --- a/utils/adwords.ts +++ b/utils/adwords.ts @@ -163,7 +163,7 @@ export const getAdwordsKeywordIdeas = async (credentials:AdwordsCredentials, adw } try { - // API: https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/generateKeywordIdeas + // API: https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers/generateKeywordIdeas const customerID = account_id.replaceAll('-', ''); const geoTargetConstants = countries[country][3]; // '2840'; const reqPayload: Record = { @@ -178,7 +178,7 @@ export const getAdwordsKeywordIdeas = async (credentials:AdwordsCredentials, adw reqPayload.siteSeed = { site: domain }; } - const resp = await fetch(`https://googleads.googleapis.com/v16/customers/${customerID}:generateKeywordIdeas`, { + const resp = await fetch(`https://googleads.googleapis.com/v18/customers/${customerID}:generateKeywordIdeas`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -297,7 +297,7 @@ export const getKeywordsVolume = async (keywords: KeywordType[]): Promise<{error for (const country in keywordRequests) { if (Object.hasOwn(keywordRequests, country) && keywordRequests[country].length > 0) { try { - // API: https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/generateKeywordHistoricalMetrics + // API: https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers/generateKeywordHistoricalMetrics const customerID = account_id.replaceAll('-', ''); const geoTargetConstants = countries[country][3]; // '2840'; const reqKeywords = keywordRequests[country].map((kw) => kw.keyword); @@ -306,7 +306,7 @@ export const getKeywordsVolume = async (keywords: KeywordType[]): Promise<{error geoTargetConstants: `geoTargetConstants/${geoTargetConstants}`, // language: `languageConstants/${language}`, }; - const resp = await fetch(`https://googleads.googleapis.com/v16/customers/${customerID}:generateKeywordHistoricalMetrics`, { + const resp = await fetch(`https://googleads.googleapis.com/v18/customers/${customerID}:generateKeywordHistoricalMetrics`, { method: 'POST', headers: { 'Content-Type': 'application/json',