Hi, When I tried to fetch Location and Language through campaign_criterion view. I am getting error that *Call to a member function getLanguageConstant() on null*
I cannot use *campaign_criterion.location.geo_target_constant using * *campaign_criterion *view? If this is the case how I can identify what view need to be use to get those data? There must be simpler API explanation which view I need to use? I am using like this $googleAdsRow->getCampaignCriterion()->getLocation()->getGeoTargetConstantUnwrapped() $googleAdsRow->getCampaignCriterion()->getLanguage()->getLanguageConstantUnwrapped() when doc said I can get those using campaign_criterion resource It must be used. https://developers.google.com/google-ads/api/fields/v4/campaign_criterion Thanks On Thursday, 13 August 2020 at 10:58:34 UTC+5:30 cv wrote: > > Hello Xiaoming, > > Yes, I was fetching like this only. > > > $googleAdsRow->getCampaignCriterion()->getLocation()->getGeoTargetConstantUnwrapped() > > > $googleAdsRow->getCampaignCriterion()->getLanguage()->getLanguageConstantUnwrapped() > > > It was already set by the user in the UI, I am just getting those values > through API. I am not setting any values. > For that I was using campaign_criterion resource as suggested by you. > > I want to get those values. > > For that I was using as explained in my previous reply. > > For frequency cap as well. I was getting the value but it only return > object instead value. > As you can see that I was quesrying campaign resource only > $googleAdsRow->getCampaign()->getFrequencyCaps() > > So my question here is how I can get those repeated fields object using > API? > > Thanks, > On Thursday, 13 August 2020 at 00:42:38 UTC+5:30 adsapiforumadvisor wrote: > >> Hi, >> >> Thank you for reaching out. Please confirm that you have set the Location >> and Language using CampaignCriterionService >> <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignCriterionService#mutate>. >> >> For frequency_caps >> <https://developers.google.com/google-ads/api/reference/rpc/v4/FrequencyCapEntry>, >> >> as it contains both key and value so it is returned as an object. You would >> need to query the campaign >> <https://developers.google.com/google-ads/api/fields/v4/campaign> >> resource to fetch the campaign.frequency_caps >> <https://developers.google.com/google-ads/api/fields/v4/campaign#campaign.frequency_caps> >> . >> >> >> >> Thanks and regards, >> Xiaoming, Google Ads API Team >> >> >> >> ref:_00D1U1174p._5004Q23I8vx:ref >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/8b6e8830-281d-4e8b-83f1-4b9a80df1202n%40googlegroups.com.