Anybody experiencing problems retrieving the "TargetRoas" field?

40 views
Skip to first unread message

vinicius....@clickbus.com

unread,
Mar 6, 2019, 5:11:51 PM3/6/19
to AdWords API and Google Ads API Forum
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,
    '
vanityPharma': None,
    '
universalAppCampaignInfo': None,
    '
selectiveOptimization': None
}

It's a very weird behaviour since it was working fine until today. Does anybody have the same issue?

Thanks in advance.

Vini

googleadsapi...@google.com

unread,
Mar 6, 2019, 10:54:17 PM3/6/19
to AdWords API and Google Ads API Forum
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

Reply all
Reply to author
Forward
0 new messages