PHP Adwords API returning wrong (?) AdGroupId

44 views
Skip to first unread message

Mike Hagendoorn

unread,
Oct 9, 2018, 6:58:28 AM10/9/18
to AdWords API and Google Ads API Forum
Hi,

I'm trying to create ads using the PHP API. The problem I'm having is the following:

I'm using this example code found on GitHub to retrieve my AdGroups. This seems to work fine and returns the 2 AdGroups I have, (I omitted the last 3 chars of the IDs):

Ad group with ID -1627709*** and name 'AdGroup 2018-10-08 09:59:11' was found.
Ad group with ID -1780708*** and name 'AdGroup 2018-10-09 08:56:30' was found.
Number of results found: 2

 However, when I try to create a ad with one of the ID's mentioned above using this example found on GitHub, the code always crashes with this error:

Fatal error: Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: [EntityNotFound.INVALID_ID @ operations[0].operand.adGroupId; trigger:'TempAdGroupId: 1780708912'] in 

After some tinkering around, I found that when you open your AdWords dashboard and navigate to your AdGroups the following is found in the URL:

&adGroupId=66938767***

When I add that ID to my code instead of the one that is returned by the GetAdGroups method, the ad is generated just fine.  

I'm at a loss here; am I doing something wrong or is the example wrong? 

Teja Makani

unread,
Oct 9, 2018, 12:12:35 PM10/9/18
to AdWords API and Google Ads API Forum
Hello Mike,

Could you please verify that while running the GetAdGroups.php and AddExpandedTextAds.php, you are pointing to the same client customer Id? If you are using the same CID and still facing the issue, please share the entire SOAP(request and response) logs for both the operations without redacting any information. You could use reply privately to the author option while sharing the data requested. Also, you could follow the instructions shown at README.md to enable logging. Could you please verify whether your PHP compiler is of 32-bit version? If yes, follow the instructions shown here to modify the code and try again.

Regards,
Sai Teja, AdWords API Team.

Mike Hagendoorn

unread,
Oct 9, 2018, 12:51:06 PM10/9/18
to AdWords API and Google Ads API Forum
Hi, 

I have responded to you privately.

Regards,
Mike

Op dinsdag 9 oktober 2018 18:12:35 UTC+2 schreef Teja Makani:

Mike Hagendoorn

unread,
Oct 12, 2018, 3:41:12 AM10/12/18
to AdWords API and Google Ads API Forum
I have fixed this. The problem was caused by the fact that I'm running a 32-bit version of PHP locally, which causes the ID to overflow. I've since installed a 64-bit version and it works flawlessly.



Op dinsdag 9 oktober 2018 12:58:28 UTC+2 schreef Mike Hagendoorn:
Reply all
Reply to author
Forward
0 new messages