Dynamic Ad Targets - Webpage URL

31 views
Skip to first unread message

vaios_pa...@hotmail.com

unread,
Feb 18, 2020, 7:11:00 PM2/18/20
to AdWords API and Google Ads API Forum
Hi,

i am using the AdGroupCriterionService (API version v201809) trying to fetch Dynamic Ad Targets.

I can successfully retrieve the Webpage criterion objects i am interested in (e.g. their Ids), but i am not able to get their Urls.

Checking the example here, i tried to get the Url like this :

$adGroupCriterion->getFinalUrls()->getUrls()[0]


but i get an error : "Call to a member function getUrls() on null".

The BiddableAdGroupCriterion Object i get looks like this:

   
    [userStatus:protected] =>
   
[systemServingStatus:protected] =>
   
[approvalStatus:protected] =>
   
[disapprovalReasons:protected] =>
   
[firstPageCpc:protected] =>
   
[topOfPageCpc:protected] =>
   
[firstPositionCpc:protected] =>
   
[qualityInfo:protected] =>
   
[biddingStrategyConfiguration:protected] =>
   
[bidModifier:protected] =>
   
[finalUrls:protected] =>
   
[finalMobileUrls:protected] =>
   
[finalAppUrls:protected] =>
   
[trackingUrlTemplate:protected] =>
   
[finalUrlSuffix:protected] =>
   
[urlCustomParameters:protected] =>
   
[adGroupId:protected] => XXXXXXXXXXX
   
[criterionUse:protected] => BIDDABLE
   
[criterion:protected] => Google\AdsApi\AdWords\v201809\cm\Webpage Object
       
(
           
[parameter:protected] =>
           
[criteriaCoverage:protected] =>
           
[criteriaSamples:protected] =>
           
[id:protected] => XXXXXXXXXXXXXXXXX
           
[type:protected] => WEBPAGE
           
[CriterionType:protected] => Webpage
           
[parameterMap:Google\AdsApi\AdWords\v201809\cm\Criterion:private] => Array
               
(
                   
[Criterion.Type] => CriterionType
               
)

       
)

   
[labels:protected] =>
   
[forwardCompatibilityMap:protected] =>
   
[baseCampaignId:protected] =>
   
[baseAdGroupId:protected] =>
   
[AdGroupCriterionType:protected] => BiddableAdGroupCriterion
   
[parameterMap:Google\AdsApi\AdWords\v201809\cm\AdGroupCriterion:private] => Array
       
(
           
[AdGroupCriterion.Type] => AdGroupCriterionType
       
)




Is this the way to get the Webpage Urls i am looking for?


Thanks in advance

Google Ads API Forum Advisor Prod

unread,
Feb 19, 2020, 3:55:43 PM2/19/20
to vaios_pa...@hotmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out. In order to get this value, you have to retrieve the WebpageParameter from the AdGroupCriterionService. Please see here for how to add that field to your selector.

I accomplished this in my own test account by following this example but replacing it with the AdGroupCriterionService and adding AdGroupCriterionField.Parameter to my selector.

Regards,
Mitchell
Google Ads API Team

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