模板广告

除了内置于 AdWords API 中的具体广告类型,模板广告还提供了引入新广告格式的灵活方式。

模板广告是由模板(由模板 ID 指定)和填充模板字段的数据组成。借助于模板广告,您可以制作未作为具体广告类型提供的广告,如 Gmail 广告、YouTube 推荐视频广告等等。有关支持的模板广告的完整列表,请参阅模板广告参考数据页

本指南介绍如何开始使用几种不同的模板广告。

应用宣传广告

可以使用 AdWords API 制作移动应用宣传广告。以下是制作应用宣传广告的示例 SOAP 请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <operations>
        <operator>ADD</operator>
        <operand>
          <adGroupId>XXXXX</adGroupId>
          <ad xsi:type="TemplateAd">
            <url>http://play.google.com/store/apps/details?id=INSERT_ANDROID_APP_PACKAGE_HERE</url>
            <displayUrl>play.google.com/store</displayUrl>
            <templateId>353</templateId>
            <templateElements>
              <uniqueName>adData</uniqueName>
              <fields>
                <name>appId</name>
                <type>TEXT</type>
                <fieldText>XXXXX</fieldText>
              </fields>
              <fields>
                <name>appStore</name>
                <type>ENUM</type>
                <fieldText>XXXXX</fieldText>
              </fields>
              <fields>
                <name>headline</name>
                <type>TEXT</type>
                <fieldText>My awesome app</fieldText>
              </fields>
              <fields>
                <name>description1</name>
                <type>TEXT</type>
                <fieldText>Must download</fieldText>
              </fields>
              <fields>
                <name>description2</name>
                <type>TEXT</type>
                <fieldText>Best app ever</fieldText>
              </fields>
            </templateElements>
            <name>My App Promotion Ad</name>
          </ad>
          <status>ENABLED</status>
        </operand>
      </operations>
    </mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

您可以为搜索网络应用互动广告系列制作应用再互动广告。这些广告定位于已经安装了您的应用的用户。

应用再互动广告有一个指向应用中特定操作的深层链接,可鼓励用户执行该操作。

以下是制作应用再互动广告的一个示例 SOAP 请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201702"
        soapenv:mustUnderstand="0">
      <ns1:clientCustomerId>...</ns1:clientCustomerId>
      <ns1:developerToken>...</ns1:developerToken>
      <ns1:userAgent>...</ns1:userAgent>
      <ns1:validateOnly>false</ns1:validateOnly>
      <ns1:partialFailure>false</ns1:partialFailure>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <operations>
        <operator>ADD</operator>
        <operand>
          <adGroupId>XXXXX</adGroupId>
          <ad xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:TemplateAd">
            <!-- Deep link -->
            <url>android-app://com.example.android/exampleapp/productid_1234</url>
            <displayUrl>example.com</displayUrl>
            <templateId>453</templateId>
            <templateElements>
              <uniqueName>adData</uniqueName>
              <fields>
                <name>appStore</name>
                <type>ENUM</type>
                <fieldText>2</fieldText>
              </fields>
              <fields>
                <name>appId</name>
                <type>TEXT</type>
                <fieldText>com.example.app</fieldText>
              </fields>
              <fields>
                <name>headline</name>
                <type>TEXT</type>
                <fieldText>Intergalactic cruise</fieldText>
              </fields>
              <fields>
                <name>description1</name>
                <type>TEXT</type>
                <fieldText>Free pretzels</fieldText>
              </fields>
              <fields>
                <name>description2</name>
                <type>TEXT</type>
                <fieldText>In-flight movies available</fieldText>
              </fields>
            </templateElements>
            <name>My App Reengagement Ad</name>
          </ad>
          <status>ENABLED</status>
        </operand>
      </operations>
    </mutate>
  </soapenv:Body>
</soapenv:Envelope>

Gmail 广告

以下各节描述了如何制作几种不同类型的 Gmail 广告

Gmail 图片广告

以下是制作 Gmail 图片广告的一个示例 SOAP 请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
        <operations>
            <operator>ADD</operator>
            <operand>
                <adGroupId>XXXXX</adGroupId>
                <ad xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:TemplateAd">
                    <displayUrl>www.example.com</displayUrl>
                    <finalUrls>http://www.example.com</finalUrls>
                    <templateId>459</templateId>
                    <templateElements>
                        <uniqueName>adData</uniqueName>
                        <fields>
                            <name>layout</name>
                            <type>ENUM</type>
                            <fieldText>gmail_image_ad_v1</fieldText>
                        </fields>
                        <fields>
                            <name>image</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                        <fields>
                            <name>description</name>
                            <type>TEXT</type>
                            <fieldText>Round trip to Mars</fieldText>
                        </fields>
                        <fields>
                            <name>subject</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic cruise</fieldText>
                        </fields>
                        <fields>
                            <name>advertiser</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic Cruises, Inc.</fieldText>
                        </fields>
                        <fields>
                            <name>logo</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                    </templateElements>
                    <name>Gmail image ad</name>
                </ad>
                <status>PAUSED</status>
            </operand>
        </operations>
    </mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Gmail 单一推广广告

以下是制作 Gmail 单一推广广告的一个示例 SOAP 请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
        <operations>
            <operator>ADD</operator>
            <operand>
                <adGroupId>XXXXX</adGroupId>
                <ad xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:TemplateAd">
                    <displayUrl>www.example.com</displayUrl>
                    <finalUrls>http://www.example.com</finalUrls>
                    <templateId>464</templateId>
                    <templateElements>
                        <uniqueName>adData</uniqueName>
                        <fields>
                            <name>layout</name>
                            <type>ENUM</type>
                            <fieldText>gmail_single_promotion_ad_v1</fieldText>
                        </fields>
                        <fields>
                            <name>callToActionUrl1</name>
                            <type>URL</type>
                            <fieldText>http://www.example.com/booktrip</fieldText>
                        </fields>
                        <fields>
                            <name>callToActionButton1ButtonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>callToActionButton1TextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>callToActionButton1</name>
                            <type>TEXT</type>
                            <fieldText>Book trip</fieldText>
                        </fields>
                        <fields>
                            <name>content</name>
                            <type>TEXT</type>
                            <fieldText>Great deals on Venus</fieldText>
                        </fields>
                        <fields>
                            <name>headlineTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f9</fieldText>
                        </fields>
                        <fields>
                            <name>headline</name>
                            <type>TEXT</type>
                            <fieldText>Book now</fieldText>
                        </fields>
                        <fields>
                            <name>image</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                        <fields>
                            <name>description</name>
                            <type>TEXT</type>
                            <fieldText>Space flights</fieldText>
                        </fields>
                        <fields>
                            <name>subject</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic cruises</fieldText>
                        </fields>
                        <fields>
                            <name>advertiser</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic Cruises, Inc.</fieldText>
                        </fields>
                        <fields>
                            <name>logo</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                    </templateElements>
                    <name>Gmail single promotion ad</name>
                </ad>
                <status>PAUSED</status>
            </operand>
        </operations>
    </mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Gmail 多产品广告

以下是制作 Gmail 多产品广告的一个示例 SOAP 请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
        <operations>
            <operator>ADD</operator>
            <operand>
                <adGroupId>XXXXX</adGroupId>
                <ad xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201702" xsi:type="ns2:TemplateAd">
                    <displayUrl>www.example.com</displayUrl>
                    <finalUrls>http://www.example.com</finalUrls>
                    <templateId>466</templateId>
                    <templateElements>
                        <uniqueName>adData</uniqueName>
                        <fields>
                            <name>layout</name>
                            <type>ENUM</type>
                            <fieldText>gmail_multi_product_ad_v1</fieldText>
                        </fields>
                        <fields>
                            <name>content</name>
                            <type>TEXT</type>
                            <fieldText>Choose your destination</fieldText>
                        </fields>
                        <fields>
                            <name>headlineTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f9</fieldText>
                        </fields>
                        <fields>
                            <name>headline</name>
                            <type>TEXT</type>
                            <fieldText>Multiple destinations available</fieldText>
                        </fields>
                        <fields>
                            <name>header</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                        <fields>
                            <name>product_5_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_5_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_5_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_4_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_4_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_4_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_3_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_3_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_3_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_2_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_2_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_2_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_buttonColor</name>
                            <type>ENUM</type>
                            <fieldText>#4486f8</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_buttonTextColor</name>
                            <type>ENUM</type>
                            <fieldText>#ffffff</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_titleColor</name>
                            <type>ENUM</type>
                            <fieldText>#000000</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_buttonText</name>
                            <type>TEXT</type>
                            <fieldText>Cruise to Venus</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_buttonUrl</name>
                            <type>URL</type>
                            <fieldText>http://www.example.com/venus</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_title</name>
                            <type>TEXT</type>
                            <fieldText>Book Venus trip</fieldText>
                        </fields>
                        <fields>
                            <name>product_1_image</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                        <fields>
                            <name>product_0_buttonText</name>
                            <type>TEXT</type>
                            <fieldText>Cruise to Mars</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_buttonUrl</name>
                            <type>URL</type>
                            <fieldText>http://www.example.com/mars</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_title</name>
                            <type>TEXT</type>
                            <fieldText>Book Mars trip</fieldText>
                        </fields>
                        <fields>
                            <name>product_0_image</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                        <fields>
                            <name>description</name>
                            <type>TEXT</type>
                            <fieldText>Travel to your favorite planet</fieldText>
                        </fields>
                        <fields>
                            <name>subject</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic cruises</fieldText>
                        </fields>
                        <fields>
                            <name>advertiser</name>
                            <type>TEXT</type>
                            <fieldText>Intergalactic Cruises, Inc.</fieldText>
                        </fields>
                        <fields>
                            <name>logo</name>
                            <type>IMAGE</type>
                            <fieldMedia xsi:type="ns2:Image">
                                <data>INSERT_BASE_64_ENCODED_BYTES_FROM_IMAGE_FILE_HERE</data>
                            </fieldMedia>
                        </fields>
                    </templateElements>
                    <name>Gmail multi-product ad</name>
                </ad>
                <status>PAUSED</status>
            </operand>
        </operations>
    </mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

HTML5 广告

您可以使用 API 来制作 HTML5 广告

以下是将 ZIP 文件用作源代码,制作 HTML5 广告的示例 SOAP 请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <operations>
        <operator>ADD</operator>
        <operand>
          <adGroupId>XXXXX</adGroupId>
            <ad xsi:type="TemplateAd">
            <displayUrl>www.example.com/html5</displayUrl>
            <finalUrls>http://example.com/html5</finalUrls>
            <templateId>419</templateId>
            <templateElements>
              <uniqueName>adData</uniqueName>
              <fields>
                <name>Custom_layout</name>
                <type>MEDIA_BUNDLE</type>
                <fieldMedia xsi:type="MediaBundle">
                  <type>MEDIA_BUNDLE</type>
                  <data>INSERT_BASE_64_ENCODED_BYTES_FROM_ZIP_FILE_HERE</data>
                  <entryPoint>carousel/index.html</entryPoint>
                </fieldMedia>
              </fields>
              <fields>
                <name>layout</name>
                <type>ENUM</type>
                <fieldText>Custom</fieldText>
              </fields>
            </templateElements>
            <dimensions>
              <width>300</width>
              <height>250</height>
            </dimensions>
            <name>Ad for HTML5</name>
          </ad>
          <status>ENABLED</status>
        </operand>
      </operations>
    </mutate>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

HTML5 媒体捆绑包

您可以使用 MediaService 上传 HTML5 媒体捆绑包,如包含 HTML5 内容的 ZIP 文件。

以下是使用 MediaService 上传 HTML5 内容的一个示例请求:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Header>
    <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <clientCustomerId>...</clientCustomerId>
      <developerToken>...</developerToken>
      <userAgent>...</userAgent>
    </RequestHeader>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <upload xmlns="https://adwords.google.com/api/adwords/cm/v201702">
      <media xsi:type="MediaBundle">
        <type>MEDIA_BUNDLE</type>
        <data>INSERT_BASE_64_ENCODED_BYTES_FROM_ZIP_FILE_HERE</data>
      </media>
    </upload>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

发送以下问题的反馈:

此网页
AdWords API
AdWords API
需要帮助?请访问我们的支持页面