Hi All,

I use the sample code form the googleads-python-lib to create the moble app 
install ads, but I am not able to choose the below option after the adgroup 
is created.

<https://lh3.googleusercontent.com/-w0RDv5pWrU0/VtP7f7G6YYI/AAAAAAAAA5Q/vCn9PW2q31E/s1600/%25E5%25B1%258F%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7%2B2016-02-29%2B%25E4%25B8%258B%25E5%258D%25884.03.39.png>

<https://lh3.googleusercontent.com/-PHqj7VEHELY/VtP-bhXr-uI/AAAAAAAAA5o/uEVf2zCOueI/s1600/%25E5%25B1%258F%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7%2B2016-02-29%2B%25E4%25B8%258B%25E5%258D%25884.16.32.png>



This is the the adgroup created by the api, please notice that the option 
is not available and the type is not aggressive:
<https://lh3.googleusercontent.com/-VuJlGL1rBv0/VtP6tRkH68I/AAAAAAAAA5I/47MHJDBWIC4/s1600/%25E5%25B1%258F%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7%2B2016-02-29%2B%25E4%25B8%258B%25E5%258D%25884.00.22.png>

<https://lh3.googleusercontent.com/-syTUII3kSC0/VtP95h3oq7I/AAAAAAAAA5c/hSoOtrlJQiI/s1600/%25E5%25B1%258F%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7%2B2016-02-29%2B%25E4%25B8%258B%25E5%258D%25884.14.07.png>

This is the adgroup created with ExplorerAutoOptimizerSetting as true, 
however, this option could not be check off after setting it to true in the 
api.  please notice that the option is not available and the type *is *
aggressive

<https://lh3.googleusercontent.com/-jW2Dratij1M/VtP987rPP1I/AAAAAAAAA5g/nXShBrLht2c/s1600/%25E5%25B1%258F%25E5%25B9%2595%25E5%25BF%25AB%25E7%2585%25A7%2B2016-02-29%2B%25E4%25B8%258B%25E5%258D%25884.12.27.png>


Below is the code.

import uuid

from googleads import adwords
import datetime


CAMPAIGN_ID = 'INSERT_CAMPAIGN_ID_HERE'

def make_campaign(client):
    # Initialize appropriate services.
    campaign_service = client.GetService('CampaignService', 
version='v201601')
    budget_service = client.GetService('BudgetService', version='v201601')
  
    # Create a budget, which can be shared by multiple campaigns.
    budget = {
        'name': 'Interplanetary budget #%s' % uuid.uuid4(),
        'amount': {
            'microAmount': '50000000'
        },
        'deliveryMethod': 'STANDARD',
        'period': 'DAILY'
    }
  
    budget_operations = [{
        'operator': 'ADD',
        'operand': budget
    }]
  
    # Add the budget.
    budget_id = budget_service.mutate(budget_operations)['value'][0][
        'budgetId']
  
    # Construct operations and add campaigns.
    operations = [{
      'operator': 'ADD',
      'operand': {
          'name': 'Interplanetary Cruise #%s' % uuid.uuid4(),
          'status': 'PAUSED',
          'advertisingChannelType': 'DISPLAY',
          'biddingStrategyConfiguration': {
              'biddingStrategyType': 'MANUAL_CPC',
          },
          'endDate': (datetime.datetime.now() +
                      datetime.timedelta(365)).strftime('%Y%m%d'),
          # Note that only the budgetId is required
          'budget': {
              'budgetId': budget_id
          },
          'advertisingChannelSubType': 'DISPLAY_MOBILE_APP',
          # Optional fields
          'startDate': (datetime.datetime.now() +
                        datetime.timedelta(1)).strftime('%Y%m%d'),
          'adServingOptimizationStatus': 'ROTATE',
          'frequencyCap': {
              'impressions': '5',
              'timeUnit': 'DAY',
              'level': 'ADGROUP'
          },
          'settings': [
              {
                  'xsi_type': 'GeoTargetTypeSetting',
                  'positiveGeoTargetType': 'DONT_CARE',
                  'negativeGeoTargetType': 'DONT_CARE'
              }
          ]}}]
    campaigns = campaign_service.mutate(operations)
    
    # Display results.
    for campaign in campaigns['value']:
      print ('Campaign with name \'%s\' and id \'%s\' was added.'
             % (campaign['name'], campaign['id']))
      return campaign['id']
          

def main(client, campaign_id):
  # Initialize appropriate service.
  ad_group_service = client.GetService('AdGroupService', version='v201601')

  # Construct operations and add ad groups.
  operations = [{
      'operator': 'ADD',
      'operand': {
          'campaignId': campaign_id,
          'name': 'Earth to Mars Cruises #%s' % uuid.uuid4(),
          'status': 'ENABLED',
          'biddingStrategyConfiguration': {
              'bids': [
                  {
                      'xsi_type': 'CpaBid',
                      'bid': {
                          'microAmount': '1000000'
                      },
                  }
              ]
          },
          'settings': [
              {
                  # Targeting restriction settings. Depending on the
                  # criterionTypeGroup value, most TargetingSettingDetail 
only
                  # affect Display campaigns. However, the
                  # USER_INTEREST_AND_LIST value works for RLSA campaigns -
                  # Search campaigns targeting using a remarketing list.
                  'xsi_type': 'TargetingSetting',
                  'details': [
                      # Restricting to serve ads that match your ad group
                      # placements. This is equivalent to choosing
                      # "Target and bid" in the UI.
                      {
                          'xsi_type': 'TargetingSettingDetail',
                          'criterionTypeGroup': 'PLACEMENT',
                          'targetAll': 'false',
                      },
                      # Using your ad group verticals only for bidding. 
This is
                      # equivalent to choosing "Bid only" in the UI.
                      {
                          'xsi_type': 'TargetingSettingDetail',
                          'criterionTypeGroup': 'VERTICAL',
                          'targetAll': 'true',
                      },
                  ]
              }
          ]
      }
  }]
  ad_groups = ad_group_service.mutate(operations)

  # Display results.
  for ad_group in ad_groups['value']:
    print ('Ad group with name \'%s\' and id \'%s\' was added.'
           % (ad_group['name'], ad_group['id']))


if __name__ == '__main__':
  # Initialize client object.
    adwords_client = adwords.AdWordsClient.LoadFromStorage()
    CAMPAIGN_ID = make_campaign(adwords_client)
    main(adwords_client, CAMPAIGN_ID)


Best Regards,
Sonic Sun.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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 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/27417ae1-659c-42a3-8a65-c2a5161234eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • not able to ch... maxSonic Sun
    • Re: not a... 'Anthony Madrigal' via AdWords API Forum
      • Re: n... maxSonic Sun
        • R... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum
          • ... maxSonic Sun
            • ... 'Nadine Sundquist (AdWords API Team)' via AdWords API Forum

Reply via email to