def CreateAdsWithCustomizations(client, adgroup_ids, feed_name):
  """Creates TextAds that use ad customizations for the specified AdGroups.

  Args:
    client: an AdWordsClient instance.
    adgroup_ids: a list containing the AdGroup ids to add TextAds to.
    feed_name: the name of the feed used to apply customizations.

  Raises:
    GoogleAdsError: if no TextAds were added.
  """
  # Get the AdGroupAdService
  adgroup_ad_service = client.GetService('AdGroupAdService')

  text_ad = {
      'xsi_type': 'TextAd',
      'headline': feed_name % 'Luxury Cruise to {=%s.Name}',
      'description1': 'Only {=%s.Price}' % feed_name,
      'description2': 'Offer ends in {=countdown(%s.Date)}!' % feed_name,
      'finalUrls': ['http://www.example.com'],
      'displayUrl': 'www.example.com'
  }

  # We add the same ad to both ad groups. When they serve, they will show
  # different values, since they match different feed items.
  operations = [{
      'operator': 'ADD',
      'operand': {
          'adGroupId': adgroup,
          'ad': text_ad
      }
  } for adgroup in adgroup_ids]

  response = adgroup_ad_service.mutate(operations)

  if response and 'value' in response:
    for ad in response['value']:
      print ('Created an ad with ID \'%s\', type \'%s\', and status \'%s\'.'
             % (ad['ad']['id'], ad['ad']['Ad.Type'], ad['status']))
  else:
    raise errors.GoogleAdsError('No ads were added.')
dataset/ETHPy150Open googleads/googleads-python-lib/examples/adwords/v201509/advanced_operations/add_ad_customizer.py/CreateAdsWithCustomizations/swapped operands of `%`