Getting wrong/different AdGroupIds when running basic operation "get ad groups"

37 views
Skip to first unread message

Garik Tate

unread,
Jul 13, 2017, 5:27:49 AM7/13/17
to AdWords API Forum
Hey guys,

I'm using the basic operation "get ad groups" in php (found here: https://developers.google.com/adwords/api/docs/samples/php/basic-operations#get-ad-groups).
When I run it however, it's giving me different ad group ID's then what I'm seeing in my reports, and my UI.

For instance when I ran it on a test campaign it gave me the result 
"Ad group with ID -870883614 and name 'Ad Group #1' was found. Number of results found: 1"

But the actual ID for that Adgruop that I'm seeing in my UI and my reports is "37783822050".


What am I doing wrong to get these different adgroup ID's when I use this basic operation? How can I fix it?

Shwetha Vastrad (AdWords API Team)

unread,
Jul 13, 2017, 10:42:47 AM7/13/17
to AdWords API Forum
Hi Garik, 

Could you check if you are using a 32-bit PHP? If you're using 32-bit PHP, you'll need to change all instances of intval() to floatval() before running an example. This is due to some IDs exceeding the 32-bit PHP_INT_MAX that intval() changes your value to. Please retry this example after performing this change and let me know if it works. 

Regards,
Shwetha, AdWords API Team.

Garik Tate

unread,
Jul 14, 2017, 5:05:43 AM7/14/17
to AdWords API Forum
Hey Shwetha,

Yep I'm currently using 32-bit PHP. After doing a little bit more research, I now see that that's the problem.

I don't know of a simple way to convert all intval() to floatval() across all files (if you know, please tell me). But now I know what the problem is. Thank you!
Reply all
Reply to author
Forward
0 new messages