Adds a new Smart Shopping campaign.

  Args:
    client: an AdWordsClient instance.
    budget_id: the str ID of the budget to be associated with the Shopping
      campaign.
    merchant_id: the str ID of the merchant account to be associated with the
      Shopping campaign.
  Returns:
    A campaign ID.

def CreateSmartCampaign(client, budget_id, merchant_id):
  """Adds a new Smart Shopping campaign.

  Args:
    client: an AdWordsClient instance.
    budget_id: the str ID of the budget to be associated with the Shopping
      campaign.
    merchant_id: the str ID of the merchant account to be associated with the
      Shopping campaign.
  Returns:
    A campaign ID.
  """
  campaign_service = client.GetService('CampaignService', version='v201809')
  # Create campaign with required and optional settings.
  campaign = {
      'name': 'Shopping campaign #%s' % uuid.uuid4(),
      # The advertisingChannelType is what makes this a Shopping campaign.
      'advertisingChannelType': 'SHOPPING',
      # Sets the advertisingChannelSubType to SHOPPING_GOAL_OPTIMIZED_ADS to
      # make this a Smart Shopping campaign.
      'advertisingChannelSubType': 'SHOPPING_GOAL_OPTIMIZED_ADS',
      # Recommendation: Set the campaign to PAUSED when creating it to stop the
      # ads from immediately serving. Set to ENABLED once you've added targeting
      # and the ads are ready to serve.
      'status': 'PAUSED',
      # Set portfolio budget (required).
      'budget': {'budgetId': budget_id},
      # Set a bidding strategy. Only MAXIMIZE_CONVERSION_VALUE is supported.
      'biddingStrategyConfiguration': {
          'biddingStrategyType': 'MAXIMIZE_CONVERSION_VALUE'
      },
      'settings': [{
          # All Shopping campaigns need a ShoppingSetting.
          'xsi_type': 'ShoppingSetting',
          'salesCountry': 'US',
          'merchantId': merchant_id
      }]
  }

  campaign_operations = [{
      'operator': 'ADD',
      'operand': campaign
  }]

  result = campaign_service.mutate(campaign_operations)['value'][0]

  print ('Smart Shopping campaign with name "%s" and ID "%s" was added.'
         % (result['name'], result['id']))

  return result['id']