Hi,

My apologies for the mistake. In your Selector, you need to include the "
*BiddingStrategyType*" and "*TargetCpa*" campaign fields. When processing 
the results, you may then provide a condition to filter only those bidding 
strategies that are of type TARGET_CPA, if you have strategies aside from 
the one I mentioned.

Using Java, I was able to extract the information by using the code snippet 
below :

if 
(campaign.getBiddingStrategyConfiguration().getBiddingStrategyType().toString().equals("TARGET_CPA"))
 
{
           
            BiddingScheme biddingScheme = 
campaign.getBiddingStrategyConfiguration().getBiddingScheme();
            TargetCpaBiddingScheme targetCPAScheme = 
(TargetCpaBiddingScheme) biddingScheme;
            String targetCpaValue = 
targetCPAScheme.getTargetCpa().toString();
            
            System.out.printf("Campaign with name '%s' and ID %d and 
targetCpa '%s' was found.%n", campaign.getName(),
                campaign.getId(), targetCpaValue);
            
          }


Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team


On Friday, August 10, 2018 at 5:58:32 PM UTC+8, 华阳 wrote:
>
> Get an exception when trying to add "" as select field.
>
> AdWordsApiException: Exception of type 
> 'Google.Api.Ads.AdWords.Lib.AdWordsApiException' was thrown. 
> The field name is not valid.. (Error: SelectorError.INVALID_FIELD_NAME, 
> FieldPath: serviceSelector, Trigger: biddingStrategyConfiguration)
>
>
> Selector selector = new Selector()
>                                         {
>                                             fields = new[] { 
> "biddingStrategyConfiguration" },
>                                             predicates = new Predicate[] { 
> Predicate.Equals(Campaign.FilterableFields.Status, "ENABLED"), },
>                                             paging = Paging.Default
>                                         };
>
> 在 2018年8月8日星期三 UTC-7下午11:39:23,Peter Oliquino (AdWords API Team)写道:
>
>> Hi,
>>
>> Using the CampaignService.get(), you will need to include the 
>> BiddingStrategyConfiguration 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignService.BiddingStrategyConfiguration>
>>  in 
>> your selected fields then once retrieved through the Campaign object, 
>> create an object of its type. You can then extract its BiddingScheme 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignService.BiddingStrategyConfiguration#biddingscheme>
>>  that 
>> would then allow you to identify whether it is a TargetCpaBiddingScheme 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignService.TargetCpaBiddingScheme>
>>  and 
>> then get its TargetCpa 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/CampaignService.TargetCpaBiddingScheme#targetcpa>
>>  value.
>>
>> Thanks and regards,
>> Peter
>> AdWords API Team
>>
>> On Thursday, August 9, 2018 at 12:55:27 PM UTC+8, CR EG wrote:
>>>
>>> Hey all!
>>>
>>> I am having some difficulty trying to pull the targetCPA for a specific 
>>> campaign. Here is what I have, I am using the selector to pull the campaign 
>>> that I need but when I look at the attributes returned it does not provide 
>>> the bidding strategy details. 
>>>
>>> campaign_service = client.GetService('CampaignService', 
>>> version='v201802')
>>>
>>>     selector = {
>>>         'fields': ['Name'],
>>>         'predicates': {
>>>             'field': 'Id',
>>>             'operator': 'EQUALS',
>>>             'values': campaignID
>>>         }
>>>     }
>>>
>>>     campaign = campaign_service.get(selector)
>>>
>>>
>>>
>>> Here is What is returned
>>>
>>> {
>>>     'totalNumEntries': 1,
>>>     'Page.Type': 'CampaignPage',
>>>     'entries': [
>>>         {
>>>             'id': *********,
>>>             'campaignGroupId': None,
>>>             'name': '***********',
>>>             'status': None,
>>>             'servingStatus': None,
>>>             'startDate': None,
>>>             'endDate': None,
>>>             'budget': None,
>>>             'conversionOptimizerEligibility': None,
>>>             'adServingOptimizationStatus': None,
>>>             'frequencyCap': None,
>>>             'settings': [],
>>>             'advertisingChannelType': None,
>>>             'advertisingChannelSubType': None,
>>>             'networkSetting': None,
>>>             'labels': [],
>>>             'biddingStrategyConfiguration': None,
>>>             'campaignTrialType': None,
>>>             'baseCampaignId': None,
>>>             'forwardCompatibilityMap': [],
>>>             'trackingUrlTemplate': None,
>>>             'finalUrlSuffix': None,
>>>             'urlCustomParameters': None,
>>>             'vanityPharma': None,
>>>             'selectiveOptimization': None
>>>         }
>>>     ]
>>> }
>>>
>>>
>>> Anyone have any idea? 
>>>
>>>
>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6c26f5dc-45f6-4a7d-a542-4334176743b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... CR EG
    • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... 华阳
        • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum
          • ... shean
            • ... 'Peter Oliquino (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to