Adwords API to Ads API migration

186 views
Skip to first unread message

Nick Giordano

unread,
Oct 18, 2022, 7:48:25 AM10/18/22
to Google Ads API and AdWords API Forum
Hi all,

I'm very much a novice in this area to apologies if I explain myself poorly. Any help that anyone can provide would be very very much appreciated.

We've been using Adwords API for a few years, though it was set up by a person who's no longer with the company. We received the notice about migrating to Ads API, and anticipated that our existing API would stop working in April 2022. Well, it didn't; thankfully, it carried on working.

We recently updated our PHP version to 8.1.11. In the days since, we've noticed that our Adwords API calls no longer work. Is this connected to the PHP upgrade, or is this coincidental?

I've tried searching and searching for help with migration, but am very confused about where to go and what to do. No help page I've found seems to provide information that's specific to our situation.

Here's what I can think to do. I'm going to post some of the API functions and calls we use, and hopefully people can let me know what should be expected to work and not work:

$user = new AdWordsServices();

$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile($_SERVER['DOCUMENT_ROOT']."/adsapi_php.ini")->build();

$session = (new AdWordsSessionBuilder())->fromFile($_SERVER['DOCUMENT_ROOT']."/adsapi_php.ini")->withOAuth2Credential($oAuth2Credential)->build();

$targetingIdeaService = $user->get($session,TargetingIdeaService::class);

There's much more but this might be a good starting point. Should this code still work?

Let me know if you need any more info...

Thanks,
Nick

Google Ads API Forum Advisor

unread,
Oct 18, 2022, 9:13:08 AM10/18/22
to nickjg...@gmail.com, adwor...@googlegroups.com
Hi Nick,

Thank you for reaching out to us.

Please note that AdWords API has Officially Sunset, you may check this article for more information and processes how to migrate it in Google Ads API.

On the other hand, since you are also mentioning the PHP, I would confirm to you that the PHP client library you are using is supported, you may check this documentation as it states that the library now supports PHP version 7.3 or greater.

And for this, “There's much more but this might be a good starting point. Should this code still work?
-Since it is already deprecated, I could confirm that this is already not working. However, since you are using TargetingIdeaService , I would suggest you use this KeywordPlanIdeaService instead, as this is the Equivalent Google Ads API Service. You may check this documentation for more details.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2fb79J:ref

Nick Giordano

unread,
Oct 19, 2022, 7:57:27 AM10/19/22
to Google Ads API and AdWords API Forum
Hi Heidi

Thank you! I've finally begun the migration process and have gotten somewhere.

I have a question about the API calls. With TargetingIdeaService, we received CPC data. However, unless I'm mistaken, that data isn't returned using KeywordPlanIdeaService? If it isn't, what API call do I need to use to return CPC data?

Thanks,
Nick

Google Ads API Forum Advisor

unread,
Oct 19, 2022, 11:04:31 AM10/19/22
to nickjg...@gmail.com, adwor...@googlegroups.com
Hi Nick,

Thank you for your response.

So our team can better assist you, could you confirm what specific CPC data it is you are looking for?

I asked because the generate keyword ideas feature of the Google Ads API allows for the retrieving of the KeywordPlanHistoricalMetrics that includes the average_cpc_micros.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2fb79J:ref
Reply all
Reply to author
Forward
0 new messages