How to get an ad's url using Google Ads Api v201809

27 views
Skip to first unread message

Alain Hua

unread,
Jun 26, 2020, 1:44:34 PM6/26/20
to AdWords API and Google Ads API Forum
Hello,


My selector looks like this : 
$selector->setFields(
            ['DisplayUrl', 'Url']
        );


My problem is when i am using $adGroupAd->getAd()->getUrls or $adGroupAd->getAd()->getDisplayUrl() (see the example above), it always return NULL for both fields.

I am sure that the ads that i m requesting on, have urls, so i dont understand why ?


Thanks in advance.


Google Ads API Forum Advisor Prod

unread,
Jun 26, 2020, 5:31:07 PM6/26/20
to alai...@mybestpro.com, adwor...@googlegroups.com

Hi Alain,

Thank you for reaching out. Expanded text ads do not use url, displayUrl, finalAppUrls, or devicePreference and setting these fields on an expanded text ad will cause an error. This also means that you are not able to fetch these fields for an expanded text ad through the API. Please refer to this documentation for more information.

Thanks and regards,
Xiaoming, Google Ads API Team

 



 

ref:_00D1U1174p._5004Q219kLv:ref

Alain Hua

unread,
Jun 29, 2020, 9:17:05 AM6/29/20
to AdWords API and Google Ads API Forum
Hello,

Thanks for you answer.

After reading the documentation for several times, i have found that i can get finalUrls using the field "CreativeFinalUrls" in the selector, but really, it can be so easily missed. 
The documentation for the Selector is pretty confusing because it says that FinalUrls is not a filterable field for the selector but it doesen't say "use CreativeFinalUrls instead".

I have been through the same kind of issue with the Responsive Display Ad. It doesen't say it's deprecated until you request the api, trying to create one.

Best regards,

Alain.

Google Ads API Forum Advisor Prod

unread,
Jun 29, 2020, 2:47:12 PM6/29/20
to alai...@mybestpro.com, adwor...@googlegroups.com

Hi Alain,

Thank you for reaching out. It would be great if you found that "CreativeFinalUrls" works. For the Responsive Display Ad you could refer to this blog post for more information.



Thanks and regards,
Xiaoming, Google Ads API Team


 

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