How to get the bid I set for an adgroup. More complicated than is has to be

22 views
Skip to first unread message

Monty808

unread,
Feb 2, 2021, 9:57:21 PM2/2/21
to AdWords API and Google Ads API Forum
Hi Google,

I create an ad group like the below its wonderful.  Wat is not wonderful is how to use the api to get microAmount that I set for the adgroup?  One would think I just ad a ad group to and ad group selector given and ad_group id but one would be wrong.  So How? 

operations = [

            {

              'operator': 'ADD',

              'operand': {

                  'campaignId': campaign_id,

                  'name': adgroup_hash['name'],

                  'status': adgroup_hash['status'],

                  'biddingStrategyConfiguration': {

                      'bids': [

                          {

                              'xsi_type': 'CpcBid',

                              'bid': {

                                  'microAmount': 1111111111

                              }

                          }

                      ]

                  }

              }

            }

        ]

        

        adgroups = self.adgroup_service.mutate(operations)

        

Here is how I get an adroup:


def get_adroups(self,campaign_id):

        

          # Construct selector and get all ad groups.

        offset = 0

        selector = {

            'fields': ['Id', 'Name', 'Status'],

            'predicates': [

                {

                    'field': 'CampaignId',

                    'operator': 'EQUALS',

                    'values': [campaign_id]

                }

            ],

            'paging': {

                'startIndex': str(offset),

                'numberResults': str(self.PAGE_SIZE)

            }

        }

        page = self.adgroup_service.get(selector)


        total_num_entries = page['totalNumEntries']

        #print('total_num_entries:',total_num_entries) 

        meta = {}

        for entry in page['entries']:

            meta[entry['name']] = entry

        

        return meta

Google Ads API Forum Advisor Prod

unread,
Feb 3, 2021, 2:41:49 PM2/3/21
to davidmo...@gmail.com, adwor...@googlegroups.com
Hi,

You will need to select the BiddingStrategyConfiguration in your selector to get this data back. A simpler approach is to run a report on the ad group level and select the field CpcBid.

Cheers,
Anthony

Google Logo
Anthony
Google Ads API Team
 


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