Share your feedback about the Google Ads (AdWords) API. Take the 2021 AdWords API and Google Ads API Annual Survey.


Use FeedService to create a Feed, which describes the shape of the data to be uploaded. The feed is analogous to a database table, and it may contain multiple FeedAttributes, which act as its database columns. Each attribute has a name and a type.

Since we will be creating data for sitelinks in the example below, we need to specify:

  • Link text
  • Link final URLs
  • Line 1
  • Line 2

The final rendered sitelink allows 2 lines of description in addition to the link itself.

Make sure to specify a feed origin of USER to tell Google Ads that this feed will be populated by user data, not automatically by Google Ads itself.

It is important to retrieve the full feed after creation to fetch all the relevant attribute IDs, which will be required in order to populate data to the correct attributes when creating feed items in the next step.


client =

feed = client.resource.feed do |f| = "example feed"
  f.origin = :USER

  # Specify the column name and data type. This is just raw data at this point,
  # and not yet linked to any particular purpose. The names are used to help us
  # remember what they are intended for later.
  f.attributes << client.resource.feed_attribute do |fa| = "Link Text"
    fa.type = :STRING
  f.attributes << client.resource.feed_attribute do |fa| = "Link Final URL"
    fa.type = :URL_LIST
  f.attributes << client.resource.feed_attribute do |fa| = "Line 1"
    fa.type = :STRING
  f.attributes << client.resource.feed_attribute do |fa| = "Line 2"
    fa.type = :STRING

operation = client.operation.create_resource.feed(feed)

feed_resource_name =
    client.service.feed.mutate_feeds(customer_id, [operation]).results.first.resource_name

# After we create the feed, we need to fetch it so we can determine the
# attribute IDs, which will be required when populating feed items.
feed =
  "select feed.attributes from feed where feed.resource_name = '#{feed_resource_name}'"

attribute_ids = {|attribute|}