def _AddDSATargeting(client, ad_group_id, label_name):
  """Set custom targeting for the page feed URLs based on a list of labels.

  Args:
    client: an AdWordsClient instance.
    ad_group_id: a str AdGroup ID.
    label_name: a str label name.

  Returns:
    A suds.sudsobject.Object representing the newly created webpage criterion.
  """
  # Get the AdGroupCriterionService.
  ad_group_criterion_service = client.GetService('AdGroupCriterionService',
                                                 version='v201809')

  # Create the operation.
  operation = {
      'operand': {
          'xsi_type': 'BiddableAdGroupCriterion',
          'adGroupId': ad_group_id,
          # Create a webpage criterion.
          'criterion': {
              'xsi_type': 'Webpage',
              'parameter': {
                  'criterionName': 'Test criterion',
                  # Add a condition for label=specified_label_name.
                  'conditions': [{
                      'operand': 'CUSTOM_LABEL',
                      'argument': label_name
                  }],
              }
          },
          # Set a custom bid for this criterion
          'biddingStrategyConfiguration': {
              'bids': [{
                  'xsi_type': 'CpcBid',
                  'bid': {
                      'microAmount': 1500000
                  }
              }]
          }
      },
      'operator': 'ADD'
  }

  criterion = ad_group_criterion_service.mutate([operation])['value'][0]
  print 'Web page criterion with ID "%d" and status "%s" was created.' % (
      criterion['criterion']['id'], criterion['userStatus'])
  return criterion
def _AddDSATargeting ( client , ad_group_id , label_name ) : ad_group_criterion_service = client . GetService ( 'AdGroupCriterionService' , version = 'v201809' ) operation = { 'operand' : { 'xsi_type' : 'BiddableAdGroupCriterion' , 'adGroupId' : ad_group_id , 'criterion' : { 'xsi_type' : 'Webpage' , 'parameter' : { 'criterionName' : 'Test criterion' , 'conditions' : [ { 'operand' : 'CUSTOM_LABEL' , 'argument' : label_name } ] , } } , 'biddingStrategyConfiguration' : { 'bids' : [ { 'xsi_type' : 'CpcBid' , 'bid' : { 'microAmount' : 1500000 } } ] } } , 'operator' : 'ADD' } criterion = ad_group_criterion_service . mutate ( [ operation ] ) [ 'value' ] [ 0 ] print 'Web page criterion with ID "%d" and status "%s" was created.' % ( criterion [ 'criterion' ] [ 'id' ] , criterion [ 'userStatus' ] ) return criterion
Set custom targeting for the page feed URLs based on a list of labels.

  Args:
    client: an AdWordsClient instance.
    ad_group_id: a str AdGroup ID.
    label_name: a str label name.

  Returns:
    A suds.sudsobject.Object representing the newly created webpage criterion.