拡張テキスト広告

拡張テキスト広告は AdWords の標準テキスト広告の次世代版です。この新しい広告では、メッセージの文字数の上限が引き上げられるとともに、よりきめ細かい管理が可能になります。拡張テキスト広告には次のような特長もあります。

2 つの広告見出し
この種類の広告には見出しフィールドが 2 つあります。2 つ目の見出しは最初の見出しフィールドに連結され、ダッシュ記号で区切られます。モバイルの場合は、一続きの見出しフィールドが 2 行目に折り返される場合があります。
文字数の上限の引き上げ
各広告見出しの文字数の上限は標準テキスト広告を上回る 30 文字です。中国語や日本語、韓国語などの全角文字言語の場合は 15 文字まで可能です。
広告文のスペースの改善
1 つの広告文に使用できる文字数の上限が 80 文字にまで引き上げられました。また、文の切り捨てや省略は最小限に抑えられており、実際の広告の表示形式がより予測しやすくなっています。
URL のカスタマイズ
広告の表示 URL の入力が不要となり、ランディング ページとパスのフィールド(path1path2)から、広告をクリックしたユーザーが誘導されるページの URL が出力されます。最終ページ URL とトラッキング URL の動作に変更はありません。

以下は、AdWords API を介してアップロードされ AdWords 管理画面に表示された、火星旅行に関するサンプル広告です。

この拡張テキスト広告のフィールドには次のような値が設定されています。

フィールド
headlinePart1 火星 #12QjNuTP へのクルーズ
headlinePart2 最高の宇宙旅行
description チケット購入はこちらから
finalUrls ["http://www.example.com/0"]
path1 すべて込み
path2 特売

対応状況

拡張テキスト広告はテスト アカウントと本番用アカウントのどちらでも作成、使用できます。

それでは、上記の火星旅行に関する広告のコードを見てみましょう。

他の種類の広告と同様、ExpandedTextAdAdGroupAdService.mutate() メソッドを使って追加できます。この種類の広告には 2 つの見出し、広告文、1 つ以上の最終ページ URL を含める必要があります。

Java

public static void runExample(
    AdWordsServices adWordsServices, AdWordsSession session, long adGroupId) throws Exception {
  // Get the AdGroupAdService.
  AdGroupAdServiceInterface adGroupAdService =
      adWordsServices.get(session, AdGroupAdServiceInterface.class);

  List<AdGroupAdOperation> operations = Lists.newArrayList();

  for (int i = 0; i < NUMBER_OF_ADS; i++) {
    // Create expanded text ad.
    ExpandedTextAd expandedTextAd = new ExpandedTextAd();
    expandedTextAd.setHeadlinePart1(String.format("Cruise #%d to Mars", i));
    expandedTextAd.setHeadlinePart2("Best Space Cruise Line");
    expandedTextAd.setDescription("Buy your tickets now!");
    expandedTextAd.setFinalUrls(new String[] {"http://www.example.com/" + i});

    // Create ad group ad.
    AdGroupAd expandedTextAdGroupAd = new AdGroupAd();
    expandedTextAdGroupAd.setAdGroupId(adGroupId);
    expandedTextAdGroupAd.setAd(expandedTextAd);

    // Optional: set the status.
    expandedTextAdGroupAd.setStatus(AdGroupAdStatus.PAUSED);

    // Create the operation.
    AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation();
    adGroupAdOperation.setOperand(expandedTextAdGroupAd);
    adGroupAdOperation.setOperator(Operator.ADD);

    operations.add(adGroupAdOperation);
  }

  // Add ads.
  AdGroupAdReturnValue result =
      adGroupAdService.mutate(operations.toArray(new AdGroupAdOperation[operations.size()]));

  // Display ads.
  for (AdGroupAd adGroupAdResult : result.getValue()) {
    ExpandedTextAd newAd = (ExpandedTextAd) adGroupAdResult.getAd();
    System.out.printf("Expanded text ad with ID %d and headline '%s - %s' was added.%n",
        newAd.getId(), newAd.getHeadlinePart1(), newAd.getHeadlinePart2());
  }
}

C#

// Get the AdGroupAdService.
AdGroupAdService service =
    (AdGroupAdService) user.GetService(AdWordsService.v201609.AdGroupAdService);

List<AdGroupAdOperation> operations = new List<AdGroupAdOperation>();

for (int i = 0; i < NUMBER_OF_ADS; i++) {
  // Create the expanded text ad.
  ExpandedTextAd expandedTextAd = new ExpandedTextAd();
  expandedTextAd.headlinePart1 = "Cruise #" + i .ToString() + " to Mars";
  expandedTextAd.headlinePart2 = "Best Space Cruise Line";
  expandedTextAd.description = "Buy your tickets now!";
  expandedTextAd.finalUrls = new string[] { "http://www.example.com/" + i };

  AdGroupAd expandedTextAdGroupAd = new AdGroupAd();
  expandedTextAdGroupAd.adGroupId = adGroupId;
  expandedTextAdGroupAd.ad = expandedTextAd;

  // Optional: Set the status.
  expandedTextAdGroupAd.status = AdGroupAdStatus.PAUSED;

  // Create the operation.
  AdGroupAdOperation operation = new AdGroupAdOperation();
  operation.@operator = Operator.ADD;
  operation.operand = expandedTextAdGroupAd;

  operations.Add(operation);
}

AdGroupAdReturnValue retVal = null;

try {
  // Create the ads.
  retVal = service.mutate(operations.ToArray());

  // Display the results.
  if (retVal != null && retVal.value != null) {
    foreach (AdGroupAd adGroupAd in retVal.value) {
      ExpandedTextAd newAd = adGroupAd.ad as ExpandedTextAd;
      Console.WriteLine("Expanded text ad with ID '{0}' and headline '{1} - {2}' was added.",
          newAd.id, newAd.headlinePart1, newAd.headlinePart2);
    }
  } else {
    Console.WriteLine("No expanded text ads were created.");
  }
} catch (Exception e) {
  throw new System.ApplicationException("Failed to create expanded text ad.", e);
}

PHP

function AddExpandedTextAdsExample(AdWordsUser $user, $adGroupId) {
  // Get the service, which loads the required classes.
  $adGroupAdService = $user->GetService('AdGroupAdService', ADWORDS_VERSION);

  // Create an expanded text ad.
  $expandedTextAd = new ExpandedTextAd();
  $expandedTextAd->headlinePart1 = 'Cruise to Mars #' . uniqid();
  $expandedTextAd->headlinePart2 = 'Best Space Cruise Line';
  $expandedTextAd->description = 'Buy your tickets now!';
  $expandedTextAd->finalUrls = array('http://www.example.com');
  $expandedTextAd->path1 = 'all-inclusive';
  $expandedTextAd->path2 = 'deals';

  // Create ad group ad.
  $adGroupAd = new AdGroupAd();
  $adGroupAd->adGroupId = $adGroupId;
  $adGroupAd->ad = $expandedTextAd;

  // Set additional settings (optional).
  $adGroupAd->status = 'PAUSED';

  // Create operation.
  $operation = new AdGroupAdOperation();
  $operation->operand = $adGroupAd;
  $operation->operator = 'ADD';

  $operations = array($operation);

  // Make the mutate request.
  $result = $adGroupAdService->mutate($operations);

  // Display results.
  foreach ($result->value as $adGroupAd) {
    printf(
        "Expanded text ad with ID '%d' and headline '%s - %s' was added.\n",
        $adGroupAd->ad->id,
        $adGroupAd->ad->headlinePart1,
        $adGroupAd->ad->headlinePart2
    );
  }
}

Perl

sub add_expanded_text_ads {
  my $client      = shift;
  my $ad_group_id = shift;

  my $num_ads    = 5;
  my @operations = ();
  for (my $i = 0 ; $i < $num_ads ; $i++) {
    # Create text ad.
    my $expanded_text_ad = Google::Ads::AdWords::v201609::ExpandedTextAd->new({
        headlinePart1 => "Cruise to Mars #" . substr(uniqid(), 0, 8),
        headlinePart2 => "Best Space Cruise Line",
        description   => "Buy your tickets now!",
        finalUrls     => ["http://www.example.com/" . $i],
        path1         => "all-inclusive",
        path2         => "deals"
    });

    # Create ad group ad for the expanded text ad.
    my $ad_group_ad = Google::Ads::AdWords::v201609::AdGroupAd->new({
        adGroupId => $ad_group_id,
        ad        => $expanded_text_ad,
        # Additional properties (non-required).
        status => "PAUSED"
    });

    # Create operation.
    my $ad_group_ad_operation =
      Google::Ads::AdWords::v201609::AdGroupAdOperation->new({
        operator => "ADD",
        operand  => $ad_group_ad
      });
    push @operations, $ad_group_ad_operation;
  }

  # Add expanded text ad.
  my $result =
    $client->AdGroupAdService()->mutate({operations => \@operations});

  # Display results.
  if ($result->get_value()) {
    foreach my $ad_group_ad (@{$result->get_value()}) {
      printf "New expanded text ad with id \"%d\" and " .
        "headline \"%s - %s\" was added.\n",
        $ad_group_ad->get_ad()->get_id(),
        $ad_group_ad->get_ad()->get_headlinePart1(),
        $ad_group_ad->get_ad()->get_headlinePart2();
    }
  } else {
    print "No expanded text ads were added.\n";
  }

  return 1;
}

Python

def main(client, ad_group_id):
  # Initialize appropriate service.
  ad_group_ad_service = client.GetService('AdGroupAdService', version='v201609')

  operations = [
      {
          'operator': 'ADD',
          'operand': {
              'xsi_type': 'AdGroupAd',
              'adGroupId': ad_group_id,
              'ad': {
                  'xsi_type': 'ExpandedTextAd',
                  'headlinePart1': ('Cruise #%s to Mars'
                                    % str(uuid.uuid4())[:8]),
                  'headlinePart2': 'Best Space Cruise Line',
                  'description': 'Buy your tickets now!',
                  'finalUrls': ['http://www.example.com/%s' % i],
              },
              # Optional fields.
              'status': 'PAUSED'
          }
      } for i in range(NUMBER_OF_ADS)
  ]
  ads = ad_group_ad_service.mutate(operations)

  # Display results.
  for ad in ads['value']:
    print ('Ad of type "%s" with id "%d" was added.'
           '\n\theadlinePart1: %s\n\theadlinePart2: %s'
           % (ad['ad']['Ad.Type'], ad['ad']['id'],
              ad['ad']['headlinePart1'], ad['ad']['headlinePart2']))

Ruby

ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION)

# Create text ads.
# The 'xsi_type' field allows you to specify the xsi:type of the object
# being created. It's only necessary when you must provide an explicit
# type that the client library can't infer.
operations = 5.times.map do |i|
  expanded_text_ad = {
    :xsi_type => 'ExpandedTextAd',
    :headline_part1 => 'Cruise to Mars #%d' % (Time.new.to_f * 1000).to_i,
    :headline_part2 => 'Best Space Cruise Line',
    :description => 'Buy your tickets now!',
    :final_urls => ['http://www.example.com/%d' % i],
    :path1 => 'all-inclusive',
    :path2 => 'deals'
  }

  ad_group_ad = {
    :ad_group_id => ad_group_id,
    :ad => expanded_text_ad,
    # Additional properties (non-required).
    :status => 'PAUSED'
  }

  operation = {
    :operator => 'ADD',
    :operand => ad_group_ad
  }
end

# Add ads.
response = ad_group_ad_srv.mutate(operations)
if response and response[:value]
  response[:value].each do |ad_group_ad|
    puts ('New expanded text ad with id "%d" and headline "%s - %s" was ' +
        'added.') % [ad_group_ad[:ad][:id], ad_group_ad[:ad][:headline_part1],
        ad_group_ad[:ad][:headline_part2]]
  end
else
  raise StandardError, 'No ads were added.'
end

作成した拡張テキスト広告を取得するには、AdType EXPANDED_TEXT_AD のフィルタリングを行う述語関数を含む AdGroupAdService.get() を呼び出します。

Java

public static void runExample(
    AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId) throws Exception {
  // Get the AdGroupAdService.
  AdGroupAdServiceInterface adGroupAdService =
      adWordsServices.get(session, AdGroupAdServiceInterface.class);

  int offset = 0;
  boolean morePages = true;

  // Create selector.
  SelectorBuilder builder = new SelectorBuilder();
  Selector selector =
      builder
          .fields(
              AdGroupAdField.Id,
              AdGroupAdField.Status,
              AdGroupAdField.HeadlinePart1,
              AdGroupAdField.HeadlinePart2,
              AdGroupAdField.Description)
          .orderAscBy(AdGroupAdField.Id)
          .offset(offset)
          .limit(PAGE_SIZE)
          .equals(AdGroupAdField.AdGroupId, adGroupId.toString())
          .in(AdGroupAdField.Status, "ENABLED", "PAUSED")
          .equals("AdType", "EXPANDED_TEXT_AD")
          .build();

  while (morePages) {
    // Get all ads.
    AdGroupAdPage page = adGroupAdService.get(selector);

    // Display ads.
    if (page.getEntries() != null && page.getEntries().length > 0) {
      for (AdGroupAd adGroupAd : page.getEntries()) {
        ExpandedTextAd expandedTextAd = (ExpandedTextAd) adGroupAd.getAd();
        System.out.printf(
            "Expanded text ad with ID %d, status '%s', and headline '%s - %s' was found.%n",
            adGroupAd.getAd().getId(),
            adGroupAd.getStatus(),
            expandedTextAd.getHeadlinePart1(),
            expandedTextAd.getHeadlinePart2());
      }
    } else {
      System.out.println("No expanded text ads were found.");
    }

    offset += PAGE_SIZE;
    selector = builder.increaseOffsetBy(PAGE_SIZE).build();
    morePages = offset < page.getTotalNumEntries();
  }
}

C#

// Get the AdGroupAdService.
AdGroupAdService service =
    (AdGroupAdService) user.GetService(AdWordsService.v201609.AdGroupAdService);

// Create a selector.
Selector selector = new Selector() {
  fields = new string[] {
    ExpandedTextAd.Fields.Id, AdGroupAd.Fields.Status, ExpandedTextAd.Fields.HeadlinePart1,
    ExpandedTextAd.Fields.HeadlinePart2, ExpandedTextAd.Fields.Description
  },
  ordering = new OrderBy[] { OrderBy.Asc(ExpandedTextAd.Fields.Id) },
  predicates = new Predicate[] {
    // Restrict the fetch to only the selected ad group id.
    Predicate.Equals(AdGroupAd.Fields.AdGroupId, adGroupId),

    // Retrieve only expanded text ads.
    Predicate.Equals("AdType", "EXPANDED_TEXT_AD"),

    // By default disabled ads aren't returned by the selector. To return
    // them include the DISABLED status in the statuses field.
    Predicate.In(AdGroupAd.Fields.Status, new string[] {
      AdGroupAdStatus.ENABLED.ToString(),
      AdGroupAdStatus.PAUSED.ToString(),
      AdGroupAdStatus.DISABLED.ToString()
    })
  },
  paging = Paging.Default
};

AdGroupAdPage page = new AdGroupAdPage();

try {
  do {
    // Get the expanded text ads.
    page = service.get(selector);

    // Display the results.
    if (page != null && page.entries != null) {
      int i = selector.paging.startIndex;

      foreach (AdGroupAd adGroupAd in page.entries) {
        ExpandedTextAd expandedTextAd = (ExpandedTextAd) adGroupAd.ad;
        Console.WriteLine("{0} : Expanded text ad with ID '{1}', headline '{2} - {3}' " +
            "and description '{4} was found.", i + 1, expandedTextAd.id,
            expandedTextAd.headlinePart1, expandedTextAd.headlinePart2,
            expandedTextAd.description);
        i++;
      }
    }
    selector.paging.IncreaseOffset();
  } while (selector.paging.startIndex < page.totalNumEntries);
  Console.WriteLine("Number of expanded text ads found: {0}", page.totalNumEntries);
} catch (Exception e) {
  throw new System.ApplicationException("Failed to get expanded text ads", e);
}

PHP

function GetExpandedTextAdsExample(AdWordsUser $user, $adGroupId) {
  // Get the service, which loads the required classes.
  $adGroupAdService = $user->GetService('AdGroupAdService', ADWORDS_VERSION);

  // Create selector.
  $selector = new Selector();
  $selector->fields =
      array('Id', 'Status', 'HeadlinePart1', 'HeadlinePart2', 'Description');
  $selector->ordering[] = new OrderBy('Id', 'ASCENDING');

  // Create predicates.
  $selector->predicates[] = new Predicate('AdGroupId', 'IN', array($adGroupId));
  $selector->predicates[] =
      new Predicate('AdType', 'IN', array('EXPANDED_TEXT_AD'));
  $selector->predicates[] =
      new Predicate('Status', 'IN', array('ENABLED', 'PAUSED'));

  // Create paging controls.
  $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
    // Make the get request.
    $page = $adGroupAdService->get($selector);

    // Display results.
    if (isset($page->entries)) {
      foreach ($page->entries as $adGroupAd) {
        printf(
            "Expanded text ad with ID '%d' status '%s', and headline '%s - %s' "
                . "was found.\n",
            $adGroupAd->ad->id,
            $adGroupAd->status,
            $adGroupAd->ad->headlinePart1,
            $adGroupAd->ad->headlinePart2
        );
      }
    } else {
      print "No expanded text ads were found.\n";
    }

    // Advance the paging index.
    $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
  } while ($page->totalNumEntries > $selector->paging->startIndex);
}

Perl

sub get_expanded_text_ads {
  my $client      = shift;
  my $ad_group_id = shift;

  # Create predicates.
  my $ad_group_predicate = Google::Ads::AdWords::v201609::Predicate->new({
      field    => "AdGroupId",
      operator => "IN",
      values   => [$ad_group_id]});
  my $status_predicate = Google::Ads::AdWords::v201609::Predicate->new({
      field    => "Status",
      operator => "IN",
      values   => ["ENABLED", "PAUSED"]});
  my $ad_type_predicate = Google::Ads::AdWords::v201609::Predicate->new({
      field    => "AdType",
      operator => "EQUALS",
      values   => ["EXPANDED_TEXT_AD"]});

  # Create selector.
  my $paging = Google::Ads::AdWords::v201609::Paging->new({
      startIndex    => 0,
      numberResults => PAGE_SIZE
  });
  my $selector = Google::Ads::AdWords::v201609::Selector->new({
      fields =>
        ["Id", "Status", "HeadlinePart1", "HeadlinePart2", "Description"],
      predicates =>
        [$ad_group_predicate, $status_predicate, $ad_type_predicate],
      ordering => [
        Google::Ads::AdWords::v201609::OrderBy->new({
            field     => "Id",
            sortOrder => "ASCENDING"
          })
      ],
      paging => $paging
    });

  # Paginate through results.
  # The contents of the subroutine will be executed for each text ad.
  Google::Ads::AdWords::Utilities::PageProcessor->new({
      client   => $client,
      service  => $client->AdGroupAdService(),
      selector => $selector
    }
    )->process_entries(
    sub {
      my ($ad_group_ad) = @_;
      printf "Expanded text ad with id \"%d\", status \"%s\", and " .
        "headline \"%s - %s\" was found.\n",
        $ad_group_ad->get_ad()->get_id(),
        $ad_group_ad->get_status(),
        $ad_group_ad->get_ad()->get_headlinePart1(),
        $ad_group_ad->get_ad()->get_headlinePart2();
    });

  return 1;
}

Python

def main(client, ad_group_id):
  # Initialize appropriate service.
  ad_group_ad_service = client.GetService('AdGroupAdService', version='v201609')

  # Construct selector and get all ads for a given ad group.
  offset = 0
  selector = {
      'fields': ['Id', 'AdGroupId', 'Status', 'HeadlinePart1', 'HeadlinePart2',
                 'Description'],
      'predicates': [
          {
              'field': 'AdGroupId',
              'operator': 'EQUALS',
              'values': [ad_group_id]
          },
          {
              'field': 'AdType',
              'operator': 'EQUALS',
              'values': ['EXPANDED_TEXT_AD']
          }
      ],
      'paging': {
          'startIndex': str(offset),
          'numberResults': str(PAGE_SIZE)
      },
      'ordering': [
          {
              'field': 'Id',
              'sortOrder': 'ASCENDING'
          }
      ]
  }
  more_pages = True
  while more_pages:
    page = ad_group_ad_service.get(selector)

    # Display results.
    if 'entries' in page:
      for ad in page['entries']:
        print ('ExpandedTextAd with id "%d", AdGroupId "%d", status "%s", '
               'headlinePart1 "%s", headlinePart2 "%s", description "%s" was '
               'found.' % (ad['ad']['id'], ad['adGroupId'], ad['status'],
                           ad['ad']['headlinePart1'], ad['ad']['headlinePart2'],
                           ad['ad']['description']))
    else:
      print 'No ads were found.'
    offset += PAGE_SIZE
    selector['paging']['startIndex'] = str(offset)
    more_pages = offset < int(page['totalNumEntries'])

Ruby

ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION)

# Get all the ads for this ad group.
selector = {
  :fields => ['Id', 'Status', 'HeadlinePart1', 'HeadlinePart2',
      'Description'],
  :ordering => [{:field => 'Id', :sort_order => 'ASCENDING'}],
  # By default, disabled ads aren't returned by the selector. To return them,
  # include the DISABLED status in a predicate.
  :predicates => [
    {
      :field => 'AdGroupId',
      :operator => 'IN',
      :values => [ad_group_id]
    },
    {
      :field => 'Status',
      :operator => 'IN',
      :values => ['ENABLED', 'PAUSED']
    },
    {
      :field => 'AdType',
      :operator => 'EQUALS',
      :values => ['EXPANDED_TEXT_AD']
    }
  ],
  :paging => {
    :start_index => 0,
    :number_results => PAGE_SIZE
  }
}

# Set initial values.
offset, page = 0, {}

begin
  page = ad_group_ad_srv.get(selector)
  if page[:entries]
    page[:entries].each do |ad_group_ad|
      puts ('Expanded text ad with ID "%d", status "%s", and headline ' +
          '"%s - %s" was found.') % [ad_group_ad[:ad][:id],
          ad_group_ad[:status], ad_group_ad[:ad][:headline_part1],
          ad_group_ad[:ad][:headline_part2]]
    end
    # Increment values to request the next page.
    offset += PAGE_SIZE
    selector[:paging][:start_index] = offset
  end
end while page[:total_num_entries] > offset

if page.include?(:total_num_entries)
  puts "\tAd group ID %d has %d expanded text ad(s)." %
      [ad_group_id, page[:total_num_entries]]
end

レポート

拡張テキスト広告のレポートでは、AdTypeEXPANDED_TEXT_AD となります。広告の掲載結果レポートで拡張テキスト広告に関するデータを容易に取得できるよう、次のフィールドが用意されています。

アップグレードのヒント

標準テキスト広告から拡張テキスト広告へのアップグレードは自動ではありません。多くの場合で 2 つ目の広告見出しを新たに作成する必要があり、拡張テキスト広告を有効にし、標準テキスト広告を無効にするタイミングも決める必要があります。

標準テキスト広告から拡張テキスト広告へアップグレードするには:

  1. 標準テキスト広告のデータに基づいて、PAUSED 状態の新しい拡張テキスト広告を作成します。標準テキスト広告の description1 の文字数は半角 35(全角 17)文字が上限であるのに対し、拡張テキスト広告の headlinePart2 は 半角 30(全角 15)文字である点にご留意ください。標準テキスト広告の description1 のテキストを拡張テキスト広告の headlinePart2 にただコピーしただけではエラーが返されます。

  2. 新しい拡張テキスト広告の approvalStatusAPPROVED になるまで待ちます。

  3. 次の 2 つのオペレーションを含む AdGroupAdService.mutate() リクエストを送信します。

    • 新しい拡張テキスト広告の statusENABLED に設定する。
    • 以前の標準テキスト広告の statusDISABLED に設定する。

コードサンプル

完全なコードサンプルはそれぞれ以下のリンクから確認できます。

フィードバックを送信...

ご不明な点がありましたら、Google のサポートページをご覧ください。