Skip to content

Commit 36ed4cf

Browse files
committed
fix: Resolves AdWords integration issue.
1 parent c8601eb commit 36ed4cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/adwords.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const getAdwordsKeywordIdeas = async (credentials:AdwordsCredentials, adw
163163
}
164164

165165
try {
166-
// API: https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/generateKeywordIdeas
166+
// API: https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers/generateKeywordIdeas
167167
const customerID = account_id.replaceAll('-', '');
168168
const geoTargetConstants = countries[country][3]; // '2840';
169169
const reqPayload: Record<string, any> = {
@@ -178,7 +178,7 @@ export const getAdwordsKeywordIdeas = async (credentials:AdwordsCredentials, adw
178178
reqPayload.siteSeed = { site: domain };
179179
}
180180

181-
const resp = await fetch(`https://googleads.googleapis.com/v16/customers/${customerID}:generateKeywordIdeas`, {
181+
const resp = await fetch(`https://googleads.googleapis.com/v18/customers/${customerID}:generateKeywordIdeas`, {
182182
method: 'POST',
183183
headers: {
184184
'Content-Type': 'application/json',
@@ -297,7 +297,7 @@ export const getKeywordsVolume = async (keywords: KeywordType[]): Promise<{error
297297
for (const country in keywordRequests) {
298298
if (Object.hasOwn(keywordRequests, country) && keywordRequests[country].length > 0) {
299299
try {
300-
// API: https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/generateKeywordHistoricalMetrics
300+
// API: https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers/generateKeywordHistoricalMetrics
301301
const customerID = account_id.replaceAll('-', '');
302302
const geoTargetConstants = countries[country][3]; // '2840';
303303
const reqKeywords = keywordRequests[country].map((kw) => kw.keyword);
@@ -306,7 +306,7 @@ export const getKeywordsVolume = async (keywords: KeywordType[]): Promise<{error
306306
geoTargetConstants: `geoTargetConstants/${geoTargetConstants}`,
307307
// language: `languageConstants/${language}`,
308308
};
309-
const resp = await fetch(`https://googleads.googleapis.com/v16/customers/${customerID}:generateKeywordHistoricalMetrics`, {
309+
const resp = await fetch(`https://googleads.googleapis.com/v18/customers/${customerID}:generateKeywordHistoricalMetrics`, {
310310
method: 'POST',
311311
headers: {
312312
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)