English | Site Directory

Google Coupon Feeds

Google Coupon Feed Documentation

Introduction
Associating Coupons with Listings
Feed Format and Location
XML Tag Definitions
Providing Formatted Address Data
Specifying Barcodes for Coupons
Appendixes

Introduction

The Google coupon service provides an opportunity for easy distribution of coupons via the web. This document explains how to create a feed that contains information about your coupons and the businesses where those coupons are valid.

Google displays coupons in a standard format to allow businesses to easily recognize those coupons when they are redeemed.

Please note that your provision of a coupon feed does not guarantee that your content will be displayed on Google Local or other Google properties. Also, by providing a feed for Google, you will not affect the ranking of your pages within Google search.

About the Feed

Google coupon feeds are XML documents that contain structured information about businesses and about special offers – coupons – that those businesses offer. The following list explains the different components of a coupon feed:

  • A listing contains information pertaining to a single business location. A listing identifies the business' name, address and phone number.

  • A coupon provides information about a special offer available from one or more of the businesses in the feed. The coupon data includes details about the offer, including an offer title, subtitle and description. A coupon can also specify an expiration date and a related image.

  • A listing collection is a combination of two or more listings. An individual listing can be included in multiple listing collections. Note: Your feed does not need to include listing collections.

  • A coupon collection is a combination of two or more coupons. An individual coupon can be included in multiple coupon collections. Note: Your feed does not need to include coupon collections.

  • A group is an association of listings and coupons. Your feed must include groups to associate coupons with the businesses where the coupons can be redeemed. A group contains either a listing collection or a list of one or more listings. A group also contains either a coupon collection or a list of one or more coupons. Please see the next section, Associating Coupons with Listings, for details and examples explaining how to associate coupons with businesses listed in your feed.

Associating Coupons with Listings

When you construct a coupon feed, you need to assign a unique ID that identifies each of the entities listed in the previous section. For example, in a coupon feed, a listing is encapsulated in a <listing> tag and is identified by a <listing_id>.

This section provides examples that demonstrate how you could create listings and coupons in your feed and then create associations between those entities. Please note that this section does not provide examples of complete XML feeds. In this section, omitted tags are represented by ellipses (...). Please refer to the sample XML feed for a complete sample of a coupon feed.

Including Business Listings in Your Feed

The following XML excerpt identifies three business listings:

<listing>
    <listing_id>101</listing_id>
    <name>Magic Pizza</name>
    <city>Mountain View</city>
    ...
</listing>
<listing>
    <listing_id>102</listing_id>
    <name>Magic Pizza Delivery</name>
    <city>Palo Alto</city>
    ...
</listing>
<listing>
    <listing_id>103</listing_id>
    <name>Falafel Hut</name>
    <city>Mountain View</city>
    ...
</listing>

For this example, the two Magic Pizza listings are different locations for the same business. Both locations offer pizza delivery, and customers can also eat at the Mountain View location. In addition, the Magic Pizza and Falafel Hut restaurants in Mountain View are both in the same shopping center.

Including Coupons in Your Feed

The listings above are from a feed that also defines four coupons as shown in the following XML excerpt:

<coupon>
    <coupon_id>201</coupon_id>
    <coupon_title>Magic Delivery Special #1</coupon_title>
    <details>Buy one pizza at regular price, get a second pizza for $5.</details>
    ...
</coupon>
<coupon>
    <coupon_id>202</coupon_id>
    <coupon_title>Magic Delivery Special #2</coupon_title>
    <details>Free small pizza with the purchase of any large pizza.</details>
    ...
</coupon>
<coupon>
    <coupon_id>203</coupon_id>
    <coupon_title>Magic Eat-In Special</coupon_title>
    <details>Free ice cream sundae with purchase of any entree.</details>
    ...
</coupon>
<coupon>
    <coupon_id>204</coupon_id>
    <coupon_title>Free soda!</coupon_title>
    <details>Get a free soda with a $5 purchase at any Mountain View Shopping Center restaurant.</details>
    ...
</coupon>

Connecting Listings to Coupons

In the XML examples to follow, the listings and coupons will be grouped together. The XML examples will create the groups in the list below. The listing_id and coupon_id values are shown in parentheses.

  • Group 1 will specify that the first two coupons (201 and 202) are valid at both Magic Pizza locations (101 and 102) since both of those restaurants offer pizza delivery.
  • Group 2 will indicate that the third coupon (203) is only valid at the Magic Pizza in Mountain View (101) since that is the only Magic Pizza location that offers the option of eating at the restaurant.
  • Group 3 will indicate that the last coupon (204) is valid at the Magic Pizza in Mountain View (101) and the Falafel Hut (103).

There are two approaches for representing this information in a coupon feed:

  1. Create <group> tags that associate <listing_id> tags with <coupon_id> tags.

    <group>
        <group_id>1</group_id>
        <listing_id>101</listing_id>
        <listing_id>102</listing_id>
        <coupon_id>201</coupon_id>
        <coupon_id>202</coupon_id>
    </group>
    <group>
        <group_id>2</group_id>
        <listing_id>101</listing_id>
        <coupon_id>203</coupon_id>
    </group>
    <group>
        <group_id>2</group_id>
        <listing_id>101</listing_id>
        <listing_id>103</listing_id>
        <coupon_id>204</coupon_id>
    </group>
    
  2. Create listing collections to combine one or more listings and create coupon collections to combine one or more coupons.

    These collections can then be used to create groups that associate listings to coupons. The following example creates two listing collections. The first collection is for all Magic Pizza restaurants, and the second collection is for all restaurants in the Mountain View Shopping Center. The example also creates a coupon collection for all coupons valid for Magic Pizza delivery. These coupons (201 and 202) are valid at all Magic Pizza locations. Finally, the example shows how you would reference those collections inside <group> tags.

    <listing_collection>
        <listing_collection_id>
            Magic-Pizza-Restaurants
        </listing_collection_id>
        <listing_id>101</listing_id>
        <listing_id>102</listing_id>
    <listing_collection>
    
    <listing_collection>
        <listing_collection_id>
            Mountain-View-Shopping-Center-Restaurants
        </listing_collection_id>
        <listing_id>101</listing_id>
        <listing_id>103</listing_id>
    <listing_collection>
    
    <coupon_collection>
        <coupon_collection_id>
            Magic-Pizza-Delivery-Coupons
        </coupon_collection_id>
        <coupon_id>201</coupon_id>
        <coupon_id>202</coupon_id>
    <coupon_collection>
    
    <!-- All Magic Pizza delivery coupons are valid at all Magic Pizza restaurants -->
    <group>
        <group_id>1</group_id>
        <listing_collection_id>
            Magic-Pizza-Restaurants
        </listing_collection_id>
        <coupon_collection_id>
            Magic-Pizza-Delivery-Coupons
        </coupon_collection_id>
    </group>
    
    <!-- There is no need to create collections to associate one coupon 
               with one business listing -->
    <group> 
        <group_id>2</group_id>
        <listing_id>101</listing_id>
        <coupon_id>203</coupon_id>
    </group>
    
    <!-- One coupon is valid at all restaurants in the Mountain View Shopping Center -->
    <group>
        <group_id>3</group_id>
        <listing_collection_id>
            Mountain-View-Shopping-Center-Restaurants
        </listing_collection_id>
        <coupon_id>204</coupon_id>
    </group>
    

In addition, you can use the <all_listings> tag, which is a collection that refers to all of the listings in your feed. You can also use the <all_coupons> tag, a predefined collection that refers to all of the coupons in your feed. For example, if all of the coupons in your feed are accepted at all of the businesses listed in your feed, your feed would only need to include one group tag:

<group>
    <group_id>10001</group_id>
    <all_listings/>
    <all_coupons/>
</group>

Feed Format and Location

  • You must host your own XML feed, and it must be accessible via HTTP or HTTPS.

  • You can supply a single XML file or multiple XML files bundled together in a single zip (*.zip) file.

  • Under no circumstances may the size of a single XML file exceed 100 MB, even if your XML file(s) get zipped.

  • If you supply a single XML file, you can provide either a plain text file or a compressed text file in zip format. Please use the filenames in the following list.

    google-coupons.xml if you provide a plain text file
    google-coupons.xml.zip if you provide a zip file

  • If your feed includes more than one XML file, you may choose the names of the individual XML files, but those files should be bundled together in a zip file named using the following convention:

    companyName-coupons.xml.zip (Please replace companyName with your company's name.)

  • To ensure that Google retrieves a complete snapshot of your data and does not attempt to download incomplete files, we recommend you use the following process when posting files to your HTTP server.

    1. Create your feed in a directory from which Google does not fetch content.

    2. After your feed is complete, create a symbolic link in a directory from which Google does fetch content. The symbolic link should point to the newly created feed.

    Google's content acquisition system will try to fetch all of the new or modified files in a particular directory (or set of directories). This process ensures that Google will not attempt to download a file until the file is complete.

Google will periodically download the feed from your server. In practice, we expect to download your feed about once each day.

Additional Guidelines

Your XML file(s) must follow these guidelines:

  • All data values, including URLs, in your feed must use escape codes for the characters listed in the following table. You can use either the entity code or the character code to represent these special characters.

     
    Character Escaped Forms
    Entity Character Code
    Ampersand & &amp; &#38;
    Single Quote ' &apos; &#39;
    Double Quote " &quot; &#34;
    Greater Than > &gt; &#62;
    Less Than < &lt; &#60;
    Copyright © unsupported &#169;
    Registered trademark ® unsupported &#174;
    Trademark unsupported &#8482;
  • Your feed must use UTF-8 encoding. Please specify this encoding schema by including the encoding attribute in your XML tag as shown in the sample XML below.

  • XML tags without data should be omitted from your feed.

  • XML tags should not contain HTML unless the XML tag definition explicitly specifies that HTML markup is acceptable.

XML Validation

Google uses an XML schema to define the acceptable structure of your XML feed. You can find this XML schema at http://code.google.com/apis/coupons/coupon_feed.xsd. To ensure that Google can process your feeds, please use an XML schema validator to ensure that your feeds comply with the requirements of this schema. Google will also verify that your content feeds comply with this XML schema.

See Appendix A - About XML Schemas for more information about XML schemas and schema validation tools.

Sample XML Feed

This XML sample shows a complete feed that contains one business listing, which is for a pizza restaurant, and one coupon. The feed also contains a group associating the listing with the coupon. Also see Appendix B for an example of a more complex feed that includes several listings and coupons and that uses listing collections and coupon collections to associate listings with coupons.

<?xml version="1.0" encoding="UTF-8"?>

<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://code.google.com/apis/coupons/coupon_feed.xsd">
    <language>en</language>
    <provider_info>
        <provider_name>Coupon Aggegrators, Inc.</provider_name>
        <provider_logo>http://www.example.com/coupon_aggregator_logo.gif</provider_logo>
        <provider_url>http://www.example.com/coupon_aggregator</provider_url>
    </provider_info>
    <datum>WGS84</datum>
    <listing>
        <listing_id>435621</listing_id>
        <name>Magic Pizza</name>
        <address format="simple">
            <component name="addr1">222 Anytown St.</component>
            <component name="city">Mountain View</component>
            <component name="province">CA</component>
            <component name="postal_code">94043</component>
        </address>
        <country>US</country>
        <latitude>37.455809</latitude>
        <longitude>-122.149710</longitude>
        <phone type="main">(650) 555-1212</phone>
        <phone type="fax">(650) 555-1234</phone>
        <category>Restaurants - Pizza</category>
        <category>Restaurants - Italian</category>
        <date month="12" day="10" year="2004"/>
    </listing>

    <coupon>
        <coupon_id>201</coupon_id>
        <business_name>Magic Pizza</business_name>
        <coupon_title>Magic Delivery Special #1</coupon_title>
        <subtitle>Extra pizza - just $5.</subtitle>
        <details>Buy one pizza at regular price, get a second pizza for $5.</details>
        <expiry_date>
            <date month="12" day="10" year="2007"/>
        </expiry_date>
        <merchant_offer_id>77P4RT</merchant_offer_id>
        <image_url>http://magicpizza.example.com/second_for_five.gif</image_url>
        <CODE_128>GU-471211</CODE_128>
    </coupon>

    <group>
        <group_id>1001</group_id>
        <listing_id>435621</listing_id>
        <coupon_id>201</coupon_id>
    </group>
</listings>

XML Tag Definitions

This section lists the XML tags and subtags that you will need to include in your feed. The tags are listed alphabetically. Each listing includes:

  • The name of the tag
  • A definition of the tag
  • Any attributes that may be provided for the tag
  • An example of the tag as it is used in the sample XML
  • A list of the subtags associated with the tag
  • A list of the tags that the tag is a subtag of
  • The content format of the tag

Note: Please omit optional tags from your feed if you do not have values for those tags. For example, if you do not have the latitudes and longitudes for the businesses in your feed, please omit the <latitude> and <longitude> tags from your feed.

Subtags Legend

Certain symbols may be displayed next to some subtags in the definitions below. These symbols, and their meanings, are:

? = optional subtag
* = zero or more instances of the subtag
+ = one or more instances of the subtag

You can use the table below to jump to tags starting with a particular letter.

ABCDEGILMNPSU

address
Definition

The <address> tag contains the address for a business listing. The tag contains address fields that are separated into different components. For more information about formatting address data, please see the Providing Formatted Address Data section of this document.

Attributes
Name Format Description
format Text Required. The format attribute identifies the format in which you are providing address data. The format attribute allows you to identify different components of an address so that addresses can be retrieved more accurately. You should provide address data in the most detailed format possible.

Valid values for the format attribute are simple and detailed. Complete instructions for providing formatted addresses can be found in the Providing Formatted Address Data section of this document.

Example <address>
Subtags component*
Subtag of listing
Content Format Container

all_coupons
Definition

The <all_coupons> tag indicates that all of the coupons in the feed are valid at any businesses that are part of the same group as the <all_coupons> tag.

The <all_coupons> tag appears within a <group> element, and the group must also identify a list of businesses that accept all of the coupons in the feed. Specific businesses can be identified using either individual listing IDs or listing collection IDs. A group can also indicate that all coupons in the feed are valid at all stores in the feed by using the <all_listings> tag in conjunction with the <all_coupons> tag.

Example <all_coupons/>
Subtag of group
Content Format Empty

all_listings
Definition

The <all_listings> tag indicates that all of the listings in the feed accepts any coupons that are part of the same group as the <all_listings> tag.

The <all_listings> tag appears within a <group> element, and the group must also identify a list of coupons that are valid at all of the business listings within the feed. Specific coupons can be identified using either individual coupon IDs or coupon collection IDs. A group can also indicate that all stores in the feed will accept all of the coupons in the feed by using the <all_coupons> tag in conjunction with the <all_listings> tag.

Example <all_listings/>
Subtag of group
Content Format Empty

business_name
Definition

The <business_name> tag identifies the business or company name that should be displayed with the coupon. The value of this tag must be 35 characters or less.

Example <business_name>Magic Pizza</business_name>
Subtag of coupon
Content Format Text

category
Definition

The <category> tag contains the navigation path that an end user would use to find a business listing in your site's taxonomy.

Example <category>Restaurants - Pizza</category>
Subtag of listing
Content Format Text

CODE_128
Definition

The <CODE_128> tag contains information that should be encoded as a Code 128 barcode. A Code 128 barcode can be used to encode data from the ASCII-128 character set. The retailer's point-of-sale system should support an application that can read the Code 128 barcode.

Please see the Specifying Barcodes for Coupons section for more information about how Google supports barcodes for coupons.

Example

<CODE_128>RG-21UR3g</CODE_128>

Subtag of coupon
Content Format Text from the ASCII-128 character set

CODE_39
Definition

The <CODE_39> tag contains information that should be encoded as a Code 39 barcode. The payload of the barcode should be customized for the point-of-sale system operated by the retailer that accepts the coupon.

A Code 39 barcode can be used to encode data from a restricted character set. The code image incorporates a checksum that is encoded in the barcode. Note: You should not specify the checksum in the <CODE_39> tag's value.

Please see the Specifying Barcodes for Coupons section for more information about how Google supports barcodes for coupons.

Example

<CODE_39>RG21 UR3</CODE_39>

Subtag of coupon
Content Format Text from a restricted character set containing 43 characters, namely 0-9, A-Z, space and "-", ".", "$", "/", "+" and "%".

component
Definition

The component tag identifies a particular component of an address, such as the street name or the city.

Attributes
Name Format Description
name Text Required. The name attribute identifies the component of an address that is represented by the value of a particular component tag. Valid values for the name attribute are listed in the Sample XML Address Formatting section of this document. That section of the document also shows sample usages of the component tag in XML feeds.

Example <component name="city">Palo Alto</component>
Subtag of address
Content Format Text

country
Definition

The <country> tag identifies the country where the listing is located. The value must be an ISO 3116 country code. For example, the United States is US and Canada is CA.

Example <country>US</country>
Subtag of listing
Content Format Text (a two-letter ISO country code)

coupon
Definition

The <coupon> tag encapsulates information pertaining to a single coupon.

Example <coupon>
Subtags coupon_id, business_name, coupon_title, subtitle?, details?, expiry_date?, merchant_offer_id?, image_url?, searchable?, CODE_128?, CODE_39?, EAN_13?, UCC_EAN_128?, UPC_A?, provider_info?
Subtag of listings
Content Format Empty

coupon_collection
Definition

The <coupon_collection> tag contains a list of related coupons, which are identified by coupon IDs.

Example <coupon_collection>
Subtags coupon_collection_id, coupon_id+
Subtag of listings
Content Format Empty

coupon_collection_id
Definition

The <coupon_collection_id> tag contains a string that uniquely identifies a coupon collection in your feed. The value may only contain alphanumeric characters, underscores, hyphens, percent signs (%) and dollar signs ($).

Example <coupon_collection_id>
    Magic-Pizza-Delivery-Coupons
</coupon_collection_id>
Subtag of coupon_collection, group
Content Format Text

coupon_id
Definition

The <coupon_id> tag contains a value that uniquely identifies a coupon in your feed. The value of this tag must be 60 characters or less and may only contain alphanumeric characters, hyphens (-), percent signs (%) and dollar signs ($).

Example <coupon_id>435621</coupon_id>
Subtag of coupon, group
Content Format Text. This value may be up to 60 characters long and may only contain the following characters: a-z, A-Z, 0-9, ".", "-", "$", "%"

coupon_title
Definition

The <coupon_title> tag contains the first line of text that displays for a coupon. The value of this tag must be 25 characters or less. Please only include complete words in the tag's value and do not end the value with abbreviated or partially hyphenated words.

Example

<coupon_title>Free soft drink</coupon_title>

Subtag of coupon
Content Format Text

date
Definition

As a subtag of <expiry_date>, the <date> tag identifies the date that a coupon expires. Otherwise, the <date> tag identifies the date that the listing was created.

Attributes
Name Format Description
year Number Required. The four-digit year that the listing or piece of content was created.
month Number Required. The month (1-12) that the listing or piece of content was created.
day Number The day (1-31) that the listing or piece of content was created.
Example <date month="12" day="15" year="2004"/>
Subtag of expiry_date, listing
Content Format Empty

datum
Definition

The <datum> tag specifies the geodetic datum, or reference model for the latitude/longitude coordinates provided in the feed. If this tag is not specified, then we will default to WGS84, which is used by most modern GPS devices. The Tokyo datum [Japanese] is only applicable to Japan.

Example <datum>TOKYO</datum>
Subtag of listings
Content Format Text. The only valid values are: WGS84, wgs84, TOKYO or tokyo.

details
Definition

The <details> tag contains a description of a coupon offer. The value of this tag must be 350 characters or less. Please only include complete words in the tag's value and do not end the value with abbreviated or partially hyphenated words.

Example <details>Receive a free medium soft drink with any $10 purchase.</details>
Subtag of coupon
Content Format Text

EAN_13
Definition

The <EAN_13> tag contains an internationalized version of the UPC-A barcode. Whereas UPC-A barcodes begin with a single-digit application identifier, EAN-13 barcodes begin with a two-digit application identifier. EAN-13 barcodes encode a check digit in the barcode image. You may include the check digit in the <EAN_13> tag's value. However, if you do not include the check digit, Google will calculate it for you and include it in the barcode.

Please see the Specifying Barcodes for Coupons section for more information about how Google supports barcodes for coupons.

Example

<EAN_13>9912345678909</EAN_13>

Subtag of coupon
Content Format

Text. Please note that the specification of an EAN-13 barcode is outside the scope of this document. The coupon provider is advised to consult with the relevant standards organization if it has questions about the EAN-13 format.


expiry_date
Definition

The <expiry_date> tag identifies the date that a coupon expires.

Example <expiry_date>
Subtags date
Subtag of coupon
Content Format Container

group
Definition

The <group> tag contains a list of one or more coupons and a group of one or more listings where those coupons are accepted. A group contains either a listing collection ID or a list of one or more listing IDs. It also contains either a coupon collection ID or a list of one or more coupon IDs.

Example <group>
Subtags group_id, coupon_collection_id?, coupon_id*, all_coupons?, listing_collection_id?, listing_id*, all_listings?
Subtag of listings
Content Format Empty

group_id
Definition

The <group_id> tag contains a value that uniquely identifies a group in your feed. The value may only contain alphanumeric characters, underscores, hyphens, percent signs (%) and dollar signs ($).

Example <group_id>1001</group_id>
Subtag of group
Content Format Text. This value may be up to 60 characters long and may only contain the following characters: a-z, A-Z, 0-9, ".", "-", "$", "%"

id
Definition

The <id> tag contains a unique ID identifying a business listing on your site.

Example <id>435621</id>
Subtag of listing
Content Format Text

image_url
Definition

The <image_url> tag identifies the URL for an image associated with a coupon. The image must be a .gif, .jpg or .png file. It may be up to 120 pixels high and 120 pixels wide. You may not provide animated images. Google will store your image and serve it from Google's image servers.

Example <image_url>http://www.example.com/cheese_pizza.gif</image_url>
Subtag of coupon
Content Format Text

language
Definition

Optional. The <language> tag identifies the language used in this feed. The value must be an ISO 639 two-letter language code.

Example <language>en<language>
Subtag of listings
Content Format Two-letter ISO language code

latitude
Definition

The <latitude> tag identifies the latitude that corresponds to the location of the listing.

The value of this tag is a floating-point number between "-90.0" and "90.0" inclusive.

Example <latitude>37.455809</latitude>
Subtag of listing
Content Format Floating-point number between "-90.0" and "90.0" inclusive

listing
Definition

The <listing> tag encapsulates all of the information pertaining to a single business.

Example <listing>
Subtags address, category*, country, date?, id?, listing_id, latitude?, longitude?, name, phone*
Subtag of listings
Content Format Empty

listing_collection
Definition

The <listing_collection> tag contains a list of related listings, which are identified by listing IDs.

Example <listing_collection>
Subtags listing_collection_id, listing_id+
Subtag of listings
Content Format Empty

listing_collection_id
Definition

The <listing_collection_id> tag contains a string that uniquely identifies a listing collection in your feed. The value may only contain alphanumeric characters, underscores, hyphens, percent signs (%) and dollar signs ($).

Example <listing_collection_id>
    Magic-Pizza-Restaurants
</listing_collection_id>
Subtag of listing_collection, group
Content Format Text

listing_id
Definition

The <listing_id> tag contains a string that uniquely identifies a listing in your feed. This value may only contain alphanumeric characters, hyphens (-), percent signs (%) and dollar signs($).

Example <listing_id>435621</listing_id>
Subtag of listing, group
Content Format Text

listings
Definition

The <listings> tag encapsulates all of the store listings and coupons in the feed.

Example <listings>
Subtags language, provider_info?, datum?, listing+, coupon+, listing_collection*, coupon_collection*, group+
Content Format Empty

longitude
Definition

The <longitude> tag identifies the longitude that corresponds to the location of the listing.

The value of this tag is a floating-point number between "-180.0" and "180.0" inclusive.

Example <longitude>-122.149710</longitude>
Subtag of listing
Content Format Floating-point number between "-180.0" and "180.0" inclusive

merchant_offer_id
Definition

The <merchant_offer_id> tag contains a string that the merchant associates with the coupon offer. The value of this tag must be 30 characters or less.

Example <merchant_offer_id>77P4RT</merchant_offer_id>
Subtag of coupon
Content Format Text

name
Definition

The <name> tag identifies the business name for a particular listing.

Example <name>Magic Pizza</name>
Subtag of listing
Content Format Text

phone
Definition

The <phone> tag contains the phone number of the business.

Attributes
Name Format Description
type Text

Required. The type of phone number being provided. The phone number must be one of the following types:

value description
main Main voice telephone number
mobile Mobile telephone number
tollfree Toll free telephone number
fax Fax telephone number
tdd Telecommunications Device for the Deaf telephone number
Example <phone type="main">(650) 555-1212</phone>
<phone type="fax">(650) 555-1213</phone>
Subtag of listing
Content Format Text

provider_info
Definition

The <provider_info> tag contains information about the company or organization that provided the feed. This tag should only be used by third-party aggregators that collect coupons from other primary sources. The tag contents ensure that coupons can display the proper branding for these aggregators. If your organization issues the coupons in the feed, please omit this section.

Appendix C includes two examples that illustrate how this tag can be applied as a default value for an entire feed or to specific coupons within a feed (thus overriding a default value).

Example <provider_info>
Subtags provider_name?, provider_logo?, provider_url?
Subtag of listings, coupon
Content Format Container

provider_logo
Definition

Optional. The <provider_logo> tag contains the URL for a logo for the company or organization that provided the coupon feed. The logo should be a .gif, .jpg or .png image and may be up to 100 pixels wide and 21 pixels high. The logo may not contain animation.

Appendix C includes two examples that illustrate how this tag can be applied as a default value for an entire feed or to specific coupons within a feed (thus overriding a default value).

Example <provider_logo>http://www.example.com/provider_logo.gif</provider_logo>
Subtag of provider_info
Content Format Text

provider_name
Definition

Optional. The <provider_name> tag contains the name of a company or organization that aggregates coupons from other sources. The value of this tag has a maximum length of 25 characters.

Appendix C includes two examples that illustrate how this tag can be applied as a default value for an entire feed or to specific coupons within a feed (thus overriding a default value).

Example <provider_name>Coupon Providers, Inc.</provider_name>
Subtag of provider_info
Content Format Text

provider_url
Definition

Optional. The <provider_url> tag contains the URL of the landing page specified by the company or organization that provided the coupon feed.

Appendix C includes two examples that illustrate how this tag can be applied as a default value for an entire feed or to specific coupons within a feed (thus overriding a default value).

Example <provider_url>http://www.example.com</provider_url>
Subtag of provider_info
Content Format Text

searchable
Definition

The <searchable> tag contains a Boolean value that indicates whether a coupon should be indexed by search engines. By setting this tag to false, a coupon provider can better control how consumers access a coupon and use advertisements to enable consumers to locate the coupon. If you omit this tag, Google will assign a default value of true to the tag.

Example

<searchable>false</searchable>

Subtag of coupon
Content Format Boolean (true or false)

subtitle
Definition

The <subtitle> tag contains the second line of text that displays for a coupon. The value of this tag must be 35 characters or less. Please only include complete words in the tag's value and do not end the value with abbreviated or partially hyphenated words.

Example

<subtitle>with any $10 purchase</subtitle>

Subtag of coupon
Content Format Text

UCC_EAN_128
Definition

The <UCC_EAN_128> tag contains a UCC/EAN-128 barcode. This barcode format is defined by the Uniform Code Council and extends the format of the UPC-A barcode. There are five formats for UCC/EAN-128 barcodes. UCC/EAN-128 barcodes must only be used in conjunction with UPC-A or EAN-13 barcodes.

Please see the Specifying Barcodes for Coupons section for more information about how Google supports barcodes for coupons.

Example

<UCC_EAN_128>8100053898</UCC_EAN_128>

Subtag of coupon
Content Format

Text. Please note that the specification of a UCC/EAN-128 barcode is outside the scope of this document. The coupon provider is advised to consult with the relevant standards organization if it has questions about the UCC/EAN-128 format. The value for this tag must consist of only digits and may not contain spaces or parentheses.


UPC_A
Definition

The <UPC_A> tag contains a UPC-A barcode, which is the most common form of barcode in the United States. The Uniform Code Council defines the data format for UPC-A barcodes. The data used to generate the barcode consists of 11 or 12 digits, depending on whether the value includes a checksum. The first digit specifies a number system and is followed by a five-digit manufacturer's code and five more digits that represent the product family and value code for the item.

Please see the Specifying Barcodes for Coupons section for more information about how Google supports barcodes for coupons.

Example

<UPC_A>53600064035</UPC_A>
<UPC_A>536000640354</UPC_A>

Subtag of coupon
Content Format

Text. Please note that the specification of a UPC-A barcode is outside the scope of this document. The coupon provider is advised to consult with the relevant standards organization if it has questions about the UPC-A format. The value for this tag must consist of only digits and may not contain spaces or parentheses. Google will calculate the checksum if you do not include it in your feed.


Providing Formatted Address Data

The guidelines below explain simple and detailed methods for tagging address data.

Sample XML Address Formatting

The XML samples below show two different methods of including addresses in your XML feeds. Two addresses are used in the examples and each address is shown using the different address formats. The addresses are:

1. 1600 Amphitheatre Parkway
    Building 41
    Mountain View CA 94043-1351

2. Belgrave House
    76 Buckingham Palace Road
    Floor 5
    Westminster
    London SW1W 9TQ

Example 1: simple Address Format

The simple address format supports the following components:

  • addr1 - the first line of an address (Belgrave House)
  • addr2 - the second line of an address (76 Buckingham Palace Road)
  • addr3 - the third line of an address (Floor 5)
  • city - the city (London)
  • province - the state or province (CA)
  • postal_code - the postal code or zip code (SW1W 9TQ)

The following examples show how addresses formatted using the simple format would appear in your feed.

<address format="simple">
    <component name="addr1">1600 Amphitheatre Parkway</component>
    <component name="addr2">Building 41</component>
    <component name="city">Mountain View</component>
    <component name="province">CA</component>
    <component name="postal_code">94043-1351</component>
</address>

<address format="simple">
    <component name="addr1">Belgrave House</component>
    <component name="addr2">76 Buckingham Palace Road</component>
    <component name="addr3">Floor 5</component>
    <component name="city">London</component>
    <component name="postal_code">SW1W 9TQ</component>
</address>

Example 2: detailed Address Format

The detailed address format supports the following components:

  • thoroughfare_number - the street number (76)
  • thoroughfare_name - the street name (Buckingham Palace Road)
  • administrative_area_name - the state/province (CA)
  • sub_administrative_area_name - the county (Santa Clara County)
  • locality_name - the town or city (London)
  • dependent_locality_name - a large district within a city (Westminster)
  • postal_code_number - the postal code; specifically, a five-digit U.S. postal code (94043) or a complete U.K. postcode (SW1W 9TQ)
  • postal_code_number_extension - the U.S. four-digit postal code extension (1351)
  • premise_name - a building name (Belgrave House)
  • sub_premise_name - a location within a building (Floor 5)

The following examples shows how addresses formatted using the detailed format would appear in your feed.

<address format="detailed">
    <component name="thoroughfare_number">1600</component>
    <component name="thoroughfare_name">Amphitheatre Parkway</component>
    <component name="premise_name">Building 41</component>
    <component name="locality_name">Mountain View</component>
    <component name="sub_administrative_area_name">Santa Clara County</component>
    <component name="administrative_area_name">CA</component>
    <component name="postal_code_number">94043</component>
    <component name="postal_code_number_extension">1351</component>
</address>

<address format="detailed">
    <component name="thoroughfare_number">76</component>
    <component name="thoroughfare_name">Buckingham Palace Road</component>
    <component name="locality_name">London</component>
    <component name="dependent_locality_name">Westminster</component>
    <component name="postal_code_number">SW1W 9TQ</component>
    <component name="premise_name">Belgrave House</component>
    <component name="sub_premise_name">Floor 5</component>
</address>

Specifying Barcodes for Coupons

Barcodes are a convenient way of encoding data into a machine readable format that can be printed on paper. Google supports the following types of barcodes for coupons:

UPC-A, EAN-13 and UCC/EAN-128 are formats that are commonly used in printed coupons, and they use data-encoding standards that allow common point-of-sale systems to interpret their data. By contrast, Code 39 and Code 128 are generic data formats that can be used to convey any data chosen by the provider. These formats are generally used to encode data that will be interpreted by customized point-of-sale systems.

You may specify up to two barcodes for each coupon. In addition, the total amount of data that can be encoded in all of the barcodes on a single coupon is 32 bytes. Please note that the UPC-A, EAN-13 and UCC/EAN-128 formats all have predefined data formats that prescribe the length of the data being encoded. However, the Code 39 and Code 128Code 128 formats do not prescribe the length of the encoded data and could, theoretically, be used to encode data of arbitrary length.

Please contact your Google account representative if you have additional requirements for barcodes that are not described in this section.

Appendixes

Appendix A - About XML Schemas

XML schemas provide an XML-based method of describing the structure of an XML document. XML schemas use the *.xsd file extension. Like DTD files, XML schemas define the elements and attributes that can appear in a document, indicate whether elements are empty or contain text, and define parent-child relationships between different XML elements.

XML schemas are different from DTDs in a number of ways. For the purpose of creating a feed for Google, it is important to understand a couple of these differences. First, XML schemas support data types, meaning they can define whether a particular field should hold an integer, string, date, float or other type of value. Second, XML schemas can restrict the acceptable set of values for a given field. In addition to defining a field as a string, an XML schema can also provide a list of acceptable strings for that field. Similarly, XML schemas can define an acceptable range of integers for an integer field.

You can learn more about XML schemas from this XML schema tutorial or the W3C's XML Schema Primer.

XML Schema Validation Tools

There are a number of tools available to help you validate the structure of your XML feed(s). You can find a list of XML-related tools at each of the following locations:

Appendix B - Complex XML Sample Feed

This XML sample shows a complete XML feed for the example discussed in the Associating Coupons with Listings section. This feed contains three listings and four coupons. This example uses listing collections and coupon collections, both of which are optional. This feed is more complex than the one shown in the Sample XML Feed section.

<?xml version="1.0" encoding="UTF-8"?>

<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://code.google.com/apis/coupons/coupon_feed.xsd">
    <language>en</language>
    <provider_info>
        <provider_name>Coupon Aggegrators, Inc.</provider_name>
        <provider_logo>http://www.example.com/coupon_aggregator_logo.gif</provider_logo>
        <provider_url>http://www.example.com/coupon_aggregator</provider_url>
    </provider_info>
    <datum>WGS84</datum>
    <listing>
        <listing_id>435621</listing_id>
        <name>Magic Pizza</name>
        <address format="simple">
            <component name="addr1">222 Anytown St.</component>
            <component name="city">Mountain View</component>
            <component name="province">CA</component>
            <component name="postal_code">94043</component>
        </address>
        <country>US</country>
        <latitude>37.455809</latitude>
        <longitude>-122.149710</longitude>
        <phone type="main">(650) 555-1212</phone>
        <phone type="fax">(650) 555-1234</phone>
        <category>Restaurants - Pizza</category>
        <category>Restaurants - Italian</category>
        <date month="12" day="10" year="2004"/>
    </listing>
    <listing>
        <listing_id>435622</listing_id>
        <name>Magic Pizza Delivery</name>
        <address format="simple">
            <component name="addr1">100 Main St.</component>
            <component name="city">Palo Alto</component>
            <component name="province">CA</component>
            <component name="postal_code">94301</component>
        </address>
        <country>US</country>
        <phone type="main">(650) 555-1213</phone>
        <category>Restaurants - Italian</category>
        <date month="12" day="10" year="2004"/>
    </listing>
    <listing>
        <listing_id>435623</listing_id>
        <name>Falafel Hut</name>
        <address format="simple">
            <component name="addr1">246 Anytown St.</component>
            <component name="city">Mountain View</component>
            <component name="province">CA</component>
            <component name="postal_code">94043</component>
        </address>
        <country>US</country>
        <phone type="main">(650) 555-1215</phone>
        <category>Restaurants - Middle Eastern</category>
        <date month="12" day="10" year="2004"/>
    </listing>

    <coupon>
        <coupon_id>201</coupon_id>
        <business_name>Magic Pizza</business_name>
        <coupon_title>Magic Delivery Special #1</coupon_title>
        <subtitle>Extra pizza - just $5.</subtitle>
        <details>Buy one pizza at regular price, get a second pizza for $5.</details>
        <expiry_date>
            <date month="12" day="10" year="2007"/>
        </expiry_date>
        <merchant_offer_id>77P4RT</merchant_offer_id>
        <image_url>http://magicpizza.example.com/second_for_five.gif</image_url>
        <CODE_128>GU-471211</CODE_128>
    </coupon>
    <coupon>
        <coupon_id>202</coupon_id>
        <business_name>Magic Pizza</business_name>
        <coupon_title>Magic Delivery Special #2</coupon_title>
        <subtitle>Free small pizza!</subtitle>
        <details>Get a free small pizza with the purchase of any large pizza.</details>
        <expiry_date>
            <date month="12" day="10" year="2007"/>
        </expiry_date>
    </coupon>
    <coupon>
        <coupon_id>203</coupon_id>
        <business_name>Magic Pizza</business_name>
        <coupon_title>Magic Eat-In Special</coupon_title>
        <subtitle>Eat dessert for free.</subtitle>
        <details>Get a free ice cream sundae with purchase of any entree.</details>
        <expiry_date>
            <date month="12" day="10" year="2007"/>
        </expiry_date>
    </coupon>
    <coupon>
        <coupon_id>204</coupon_id>
        <business_name>Mountain View Shopping Center</business_name>
        <coupon_title>Free soda!</coupon_title>
        <details>Valid at all Mountain View Shopping Center restaurants.</details>
        <expiry_date>
            <date month="12" day="10" year="2007"/>
        </expiry_date>
    </coupon>

    <listing_collection>
        <listing_collection_id>
            Magic-Pizza-Restaurants
        </listing_collection_id>
        <listing_id>435621</listing_id>
        <listing_id>435622</listing_id>
    </listing_collection>
    <listing_collection>
        <listing_collection_id>
            Mountain-View-Shopping-Center-Restaurants
        </listing_collection_id>
        <listing_id>435621</listing_id>
        <listing_id>435623</listing_id>
    </listing_collection>

    <coupon_collection>
        <coupon_collection_id>
            Magic-Pizza-Delivery-Coupons
        </coupon_collection_id>
        <coupon_id>201</coupon_id>
        <coupon_id>202</coupon_id>
    </coupon_collection>

    <group>
        <group_id>1</group_id>
        <listing_collection_id>Magic-Pizza-Restaurants</listing_collection_id>
        <coupon_collection_id>Magic-Pizza-Delivery-Coupons</coupon_collection_id>
    </group>
    <group>
        <group_id>2</group_id>
        <listing_id>435621</listing_id>
        <coupon_id>203</coupon_id>
    </group>
    <group>
        <group_id>3</group_id>
        <listing_collection_id>Mountain-View-Shopping-Center-Restaurants</listing_collection_id>
        <coupon_id>204</coupon_id>
    </group>
</listings>

Appendix C - Sample Display for Google Coupons

The examples below illustrate two sample feeds and how Google might display coupons for your site.

Example 1: XML Feed in which default provider information is applied to all coupons

The first example is a basic XML feed. Values stored within the <provider_info≷ tag are applied to all coupons. Note that line breaks have been inserted in the value of the <details> tag to produce a printer-friendly document.

<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://code.google.com/apis/coupons/coupon_feed.xsd">
   <language>en</language>
   <provider_info>
       <provider_name>Coupon Aggegrators, Inc.</provider_name>
       <provider_logo>http://www.example.com/coupon_aggregator_logo.gif</provider_logo>
       <provider_url>http://www.example.com/coupon_aggregator</provider_url>
   </provider_info>
   ...
<coupon>
    <coupon_id>201</coupon_id>
    <business_name>Magic Pizza</business_name>
    <coupon_title>Large Pizza Special</coupon_title>
    <subtitle>A Large Pizza for only $25.</subtitle>
    <details>Offer valid only Monday-Thursday. No double coupons.
       Cash value 1/20&#162;. Limit one coupon per customer. Offer may not be
       combined with any other discounts or special offers. Any other use
       constitutes fraud. Void if distributed by unauthorized means. Must be
       18 or older or accompanied by an adult. Not available for takeout or
       catering orders.</details>
    <expiry_date>
        <date month="12" day="10" year="2007"/>
    </expiry_date>
    <merchant_offer_id>77P4RT</merchant_offer_id>
    <image_url>http://www.magicpizza.com/magicpizza.jpg</image_url>
    <CODE_128>GU-471211</CODE_128>
</coupon>

Please note that the page layout as well as the layout of the individual coupons is subject to change. The summary text view next to the coupon image demonstrates how text links to the coupon might appear on Google.

Printable coupon viewSummary text view
Large Pizza Special
A Large Pizza for only $25

There are several important points to note about the coupon:

  • The string DN5866Z6JH9K is an identifier created by Google.
  • The coupon_id supplied by the provider is not displayed on the coupon.
  • The merchant_offer_id (77P4RT) supplied by the provider is printed on the coupon. This value may contain instructions for the person who accepts the coupon.
  • The ¢ sign is specified as a numeric HTML entity.
  • The data encoded in the barcode is printed below the barcode.
  • The Coupon Aggegrators, Inc. link in the lower-right corner points to http://www.example.com/coupon_aggregator/.

Example 2: XML Feed in which unique provider information is applied to each coupon

This example illustrates the case where <provider_info> is included as a subtag of <coupon>, effectively overriding the default values stored within <listings>. In other words, this example illustrates how to specify unique provider names, provider logos, and provider URLs per coupon.

<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://code.google.com/apis/coupons/coupon_feed.xsd">
   <language>en</language>
   <provider_info>
       <provider_name>Coupon Aggegrators, Inc.</provider_name>
       <provider_logo>http://www.example.com/coupon_aggregator_logo.gif</provider_logo>
       <provider_url>http://www.example.com/coupon_aggregator</provider_url>
   </provider_info>
   ...
<coupon>
    <coupon_id>201</coupon_id>
    <business_name>Magic Pizza</business_name>
    <coupon_title>Large Pizza Special</coupon_title>
    <subtitle>A Large Pizza for only $25.</subtitle>
    <details>Offer valid only Monday-Thursday. No double coupons.
       Cash value 1/20&#162;. Limit one coupon per customer. Offer may not be
       combined with any other discounts or special offers. Any other use
       constitutes fraud. Void if distributed by unauthorized means. Must be
       18 or older or accompanied by an adult. Not available for takeout or
       catering orders.</details>
    <expiry_date>
        <date month="12" day="10" year="2007"/>
    </expiry_date>
    <merchant_offer_id>77P4RT</merchant_offer_id>
    <image_url>http://www.magicpizza.com/magicpizza.jpg</image_url>
    <CODE_128>GU-471211</CODE_128>  
    <provider_info>
       <provider_url>http://www.example.com/coupon_aggregator/view_coupon?coupon_id=201</provider_url>
    </provider_info>	
</coupon>
Printable coupon viewSummary text view
Large Pizza Special
A Large Pizza for only $25

Note that while not visually different, the Coupon Aggegrators, Inc. link now points to http://www.example.com/coupon_aggregator/view_coupon?coupon_id=201 instead of http://www.example.com/coupon_aggregator/.