Hi Vini,
To better investigate this, could you provide the complete SOAP request and
response logs when you run the request you mentioned here? Please reply via
*Reply
privately to author*.
Thanks and regards,
Luis
AdWords API Team
On 03/07/19 03:09:36 vinicius.cavalca...@clickbus.com wrote:
Hi all,
Few weeks ago I wrote a script that collects the targets for my campaigns
(Target ROAS, Target CPA, Target Outrank Share and so on). It was working
well every week, but today it failed. It's not possible to retrieve the
*TargetRoas
*field and *its a huge pain because the bidding strategies are active and I
can reach the values within the platform.*
If it helps, this is the function in Python:
def get_bidding_strategy(self, campaign_id):
service = self.client.GetService('CampaignService', version=self.
version)
selector = {
'fields': ['Id', 'Name', 'BiddingStrategyId',
'EnhancedCpcEnabled',
'BiddingStrategyName', 'BiddingStrategyType',
'TargetRoas', 'TargetCpa'],
'predicates': [
{
'field': 'Status',
'operator': 'EQUALS',
'values': 'ENABLED'
},
{
'field': 'Id',
'operator': 'EQUALS',
'values': campaign_id
}
],
}
result = service.get(selector)
campaign = result['entries'][0]
try:
strategy_type = campaign['biddingStrategyConfiguration'][
'biddingStrategyType']
except:
strategy_type = 'None'
if strategy_type == 'TARGET_ROAS':
strategy_value = campaign['biddingStrategyConfiguration'][
'biddingScheme']['targetRoas']
elif strategy_type == 'TARGET_CPA':
strategy_value = campaign['biddingStrategyConfiguration'][
'biddingScheme']['targetCpa']['microAmount'] / 1000000
elif strategy_type == 'TARGET_OUTRANK_SHARE':
strategyId = campaign['biddingStrategyConfiguration'][
'biddingStrategyId']
service = self.client.GetService('BiddingStrategyService',
version=self.version)
selector = {
'fields': ['Id', 'Name', 'BiddingScheme'],
'predicates': [
{
'field': 'Status',
'operator': 'EQUALS',
'values': 'ENABLED'
},
{
'field': 'Id',
'operator': 'EQUALS',
'values': strategyId
}
],
}
result_outrank = service.get(selector)
strategy_value = result_outrank['entries'][0]['biddingScheme'][
'targetOutrankShare'] / 1000000
elif strategy_type == 'MANUAL_CPC':
strategy_value = 'MANUAL_CPC'
else:
strategy_value = '-'
return strategy_type, strategy_value
This is the output of the variable "campaign":
{
'id': any_campaign_id,
'campaignGroupId': None,
'name': any_name,
'status': 'ENABLED',
'servingStatus': None,
'startDate': None,
'endDate': None,
'budget': None,
'conversionOptimizerEligibility': None,
'adServingOptimizationStatus': None,
'frequencyCap': None,
'settings': [],
'advertisingChannelType': None,
'advertisingChannelSubType': None,
'networkSetting': None,
'labels': [],
'biddingStrategyConfiguration': {
'biddingStrategyId': any_strategy_id,
'biddingStrategyName': any_strategy_name',
'biddingStrategyType': 'TARGET_ROAS',
'biddingStrategySource': None,
'biddingScheme': None, # ---------------- THIS FIELD SHOULD NOT BE
EMPTY! (TargetRoas would be here)
'bids': [],
'targetRoasOverride': None
},
'campaignTrialType': None,
'baseCampaignId': None,
'forwardCompatibilityMap': [],
'trackingUrlTemplate': None,
'finalUrlSuffix': None,
'urlCustomParameters': None,
'
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/00d12jcj180000018tnd9k001f3228y70mjed9l6so30c1g68qj8e9n%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.