ディスプレイ ネットワーク用レスポンシブ広告

ディスプレイ ネットワーク用レスポンシブ広告では、Google ディスプレイ ネットワークの広告枠に合わせて広告のサイズ、表示形式、フォーマットが自動的に調整されます。

ResponsiveDisplayAd には次の要素が含まれています。

  • 短い見出し
  • 長い見出し
  • 広告文
  • 会社名
  • マーケティング画像
  • 横長のロゴとスクエアのマーケティング画像
  • 行動を促すフレーズのテキスト(省略可)
  • ロゴ(省略可)
  • 販促テキスト(省略可)
  • 価格のプレフィックス(省略可)

これらのフィールドの詳細

レスポンシブ広告の作成プロセスは次の 2 段階に分かれています。

  1. MediaServiceupload() メソッドを使って、マーケティング画像、ロゴ(省略可)、横長のロゴ、スクエアのマーケティング画像をアップロードします。返された ID は後で広告を追加する際に必要になりますので、メモしておいてください。必要に応じて、ロゴ画像も同じ方法でアップロードできます。このメディア サービスを介してアップロードされた画像は、後で複数の広告で再利用することが可能です。

  2. AdGroupAdService を使用して ResponsiveDisplayAd を作成します。marketingImagelogoImagelandscapeLogoImagesquareMarketingImage については、第 1 段階で返されたメディア ID を参照してください。

それでは、ディスプレイ ネットワークを対象とするキャンペーンに画像を追加した例を見てみましょう。以下は Interplanetary Cruises(惑星間旅行)に関する画像の例で、レスポンシブ広告の画像の仕様を満たしています。

Java

/**
 * Runs the example.
 *
 * @param adWordsServices the services factory.
 * @param session the session.
 * @param adGroupId the ID of the ad group where the ad will be created.
 * @throws ApiException if the API request failed with one or more service errors.
 * @throws RemoteException if the API request failed due to other errors.
 * @throws IOException if uploading an image failed.
 */
public static void runExample(
    AdWordsServicesInterface adWordsServices, AdWordsSession session, long adGroupId)
    throws IOException {
  // Get the MediaService.
  MediaServiceInterface mediaService = adWordsServices.get(session, MediaServiceInterface.class);

  // Get the AdGroupAdService.
  AdGroupAdServiceInterface adGroupAdService =
      adWordsServices.get(session, AdGroupAdServiceInterface.class);

  // Create a responsive display ad.
  ResponsiveDisplayAd responsiveDisplayAd = new ResponsiveDisplayAd();

  // This ad format does not allow the creation of an image using the
  // Image.data field. An image must first be created using the MediaService,
  // and Image.mediaId must be populated when creating the ad.
  long marketingImageMediaId = uploadImage(mediaService, "https://goo.gl/3b9Wfh");
  Image marketingImage = new Image();
  marketingImage.setMediaId(marketingImageMediaId);
  responsiveDisplayAd.setMarketingImage(marketingImage);

  responsiveDisplayAd.setShortHeadline("Travel");
  responsiveDisplayAd.setLongHeadline("Travel the World");
  responsiveDisplayAd.setDescription("Take to the air!");
  responsiveDisplayAd.setBusinessName("Interplanetary Cruises");
  responsiveDisplayAd.setFinalUrls(new String[] {"http://www.example.com/"});

  // Optional: Create a square marketing image using MediaService, and set it
  // to the ad.
  long squareMarketingImageMediaId = uploadImage(mediaService, "https://goo.gl/mtt54n");
  Image squareMarketingImage = new Image();
  squareMarketingImage.setMediaId(squareMarketingImageMediaId);
  responsiveDisplayAd.setSquareMarketingImage(squareMarketingImage);

  // Optional: set call to action text.
  responsiveDisplayAd.setCallToActionText("Shop Now");

  // Optional: Set dynamic display ad settings, composed of landscape logo
  // image, promotion text, and price prefix.
  DynamicSettings dynamicDisplayAdSettings = createDynamicDisplayAdSettings(mediaService);
  responsiveDisplayAd.setDynamicDisplayAdSettings(dynamicDisplayAdSettings);

  // Whitelisted accounts only: Set color settings using hexadecimal values.
  // Set allowFlexibleColor to false if you want your ads to render by always
  // using your colors strictly.
  /*
  responsiveDisplayAd.setMainColor("#0000ff");
  responsiveDisplayAd.setAccentColor("#ffff00");
  responsiveDisplayAd.setAllowFlexibleColor(false);
  */

  // Whitelisted accounts only: Set the format setting that the ad will be
  // served in.
  /*
  responsiveDisplayAd.setFormatSetting(
      com.google.api.ads.adwords.axis.v201802.cm.DisplayAdFormatSetting.NON_NATIVE);
  */

  // Create ad group ad for the responsive display ad.
  AdGroupAd adGroupAd = new AdGroupAd();
  adGroupAd.setAdGroupId(adGroupId);
  adGroupAd.setAd(responsiveDisplayAd);

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

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

  // Make the mutate request.
  AdGroupAdReturnValue result =
      adGroupAdService.mutate(new AdGroupAdOperation[] {adGroupAdOperation});

  // Display ads.
  for (AdGroupAd adGroupAdResult : result.getValue()) {
    ResponsiveDisplayAd newAd = (ResponsiveDisplayAd) adGroupAdResult.getAd();
    System.out.printf(
        "Responsive display ad with ID %d and short headline '%s' was added.%n",
        newAd.getId(), newAd.getShortHeadline());
  }
}

private static DynamicSettings createDynamicDisplayAdSettings(MediaServiceInterface mediaService)
    throws IOException {
  long logoImageMediaId = uploadImage(mediaService, "https://goo.gl/dEvQeF");
  Image logo = new Image();
  logo.setMediaId(logoImageMediaId);

  DynamicSettings dynamicSettings = new DynamicSettings();
  dynamicSettings.setLandscapeLogoImage(logo);
  dynamicSettings.setPricePrefix("as low as");
  dynamicSettings.setPromoText("Free shipping!");
  return dynamicSettings;
}

/**
 * Uploads the image from the specified {@code url} via {@code MediaService}.
 *
 * @return the {@code mediaId} of the uploaded image.
 */
private static long uploadImage(MediaServiceInterface mediaService, String url)
    throws IOException {
  // Create image.
  Image image = new Image();
  image.setType(MediaMediaType.IMAGE);
  image.setData(com.google.api.ads.common.lib.utils.Media.getMediaDataFromUrl(url));

  // Upload image.
  Image uploadedImage = (Image) mediaService.upload(new Media[] {image})[0];
  return uploadedImage.getMediaId();
}

Visual Basic

Using adGroupAdService As AdGroupAdService = CType(user.GetService(
    AdWordsService.v201802.AdGroupAdService), AdGroupAdService)

  Try
    ' Create a responsive display ad.
    Dim responsiveDisplayAd As New ResponsiveDisplayAd()

    ' This ad format does not allow the creation of an image using the
    ' Image.data field. An image must first be created using the MediaService,
    ' and Image.mediaId must be populated when creating the ad.
    responsiveDisplayAd.marketingImage = New Image()
    responsiveDisplayAd.marketingImage.mediaId = UploadImage(user, "https://goo.gl/3b9Wfh")

    responsiveDisplayAd.shortHeadline = "Travel"
    responsiveDisplayAd.longHeadline = "Travel the World"
    responsiveDisplayAd.description = "Take to the air!"
    responsiveDisplayAd.businessName = "Google"
    responsiveDisplayAd.finalUrls = New String() {"http://www.example.com"}

    ' Optional: Create a square marketing image Using MediaService, And set it
    ' to the ad.
    responsiveDisplayAd.squareMarketingImage = New Image()
    responsiveDisplayAd.squareMarketingImage.mediaId =
        UploadImage(user, "https://goo.gl/mtt54n")

    ' Optional: Set call to action text.
    responsiveDisplayAd.callToActionText = "Shop Now"

    ' Optional: Set dynamic display ad settings, composed of landscape logo
    ' image, promotion text, And price prefix.
    responsiveDisplayAd.dynamicDisplayAdSettings = CreateDynamicDisplayAdSettings(user)

    ' Whitelisted accounts only Set color settings using hexadecimal values.
    ' Set allowFlexibleColor to false if you want your ads to render by always
    ' using your colors strictly.

    ' responsiveDisplayAd.mainColor = "#0000ff"
    ' responsiveDisplayAd.accentColor = "#ffff00"
    ' responsiveDisplayAd.allowFlexibleColor = false

    ' Whitelisted accounts only Set the format setting that the ad will be
    ' served in.

    ' responsiveDisplayAd.formatSetting = DisplayAdFormatSetting.NON_NATIVE;

    ' Create ad group ad.
    Dim adGroupAd As New AdGroupAd()
    adGroupAd.adGroupId = adGroupId
    adGroupAd.ad = responsiveDisplayAd
    adGroupAd.status = AdGroupAdStatus.PAUSED

    ' Create operation.
    Dim operation As New AdGroupAdOperation()
    operation.operand = adGroupAd
    operation.operator = [Operator].ADD

    ' Make the mutate request.
    Dim result As AdGroupAdReturnValue = adGroupAdService.mutate(
        New AdGroupAdOperation() {operation})

    ' Display results.
    If (Not result Is Nothing) AndAlso (Not result.value Is Nothing) Then
      For Each newAdGroupAd As AdGroupAd In result.value
        Dim newAd As ResponsiveDisplayAd = CType(newAdGroupAd.ad, ResponsiveDisplayAd)
        Console.WriteLine("Responsive display ad with ID '{0}' and short headline '{1}'" &
            " was added.", newAd.id, newAd.shortHeadline)
      Next
    Else
      Console.WriteLine("No responsive display ads were created.")
    End If
  Catch e As Exception
    Throw New System.ApplicationException("Failed to create responsive display ads.", e)
  End Try
End Using

Python

def main(client, ad_group_id):
  # Initialize appropriate services.
  ad_group_ad_service = client.GetService('AdGroupAdService', version='v201802')
  media_service = client.GetService('MediaService', version='v201802')
  opener = urllib2.build_opener(*client.proxy_config.GetHandlers())

  try:
    # Create marketing image.
    marketing_image = _CreateImage(media_service, opener,
                                   'https://goo.gl/3b9Wfh')

    # Create square marketing image.
    square_marketing_image = _CreateImage(media_service, opener,
                                          'https://goo.gl/mtt54n')

    # Create a responsive display ad.
    operations = [{
        'operator': 'ADD',
        'operand': {
            'xsi_type': 'AdGroupAd',
            'adGroupId': ad_group_id,
            'ad': {
                'xsi_type': 'ResponsiveDisplayAd',
                'marketingImage': {'mediaId': marketing_image['mediaId']},
                'shortHeadline': 'Travel',
                'longHeadline': 'Travel the World',
                'description': 'Take to the air!',
                'businessName': 'Interplanetary Cruises',
                'finalUrls': ['http://www.example.com'],
                # Optional: Set a square marketing image to the ad.
                'squareMarketingImage': {
                    'mediaId': square_marketing_image['mediaId']
                },
                # Optional: Set call-to-action text.
                'callToActionText': 'Shop Now',
                # Optional: Set dynamic display ad settings, composed of
                # landscape logo image, promotion text, and price prefix.
                'dynamicDisplayAdSettings': _CreateDynamicDisplayAdSettings(
                    media_service, opener),
                # Whitelisted accounts only: Set color settings using
                # hexadecimal numbers.
                # Set allowFlexibleColor to False if you want your ads to render
                # by always using your colors strictly.
                # 'mainColor': '#0000ff',
                # 'accentColor': '#ffff00',
                # 'allowFlexibleColor': False
                # Whitelisted accounts only: Set the format setting that the ad
                # will be served in.
                # 'formatSetting': 'NON_NATIVE'

            },
            # Optional fields.
            'status': 'PAUSED'
        }
    }]

    # Make the mutate request.
    ads = ad_group_ad_service.mutate(operations)

    # Display results.
    for ad in ads['value']:
      print ('ResponsiveDisplayAd with id "%d" and short headline "%s" was '
             'added.' % (ad['ad']['id'], ad['ad']['shortHeadline']))

  except:
    raise Exception('Failed to create responsive display ad.')

def _CreateImage(media_service, opener, url):
  """Creates an image and uploads it to the server.

  Args:
    media_service: a SudsServiceProxy instance for AdWords's MediaService.
    opener: an OpenerDirector instance.
    url: a str URL used to load image data.

  Returns:
    The image that was successfully uploaded.
  """
  # Note: The utf-8 decode is for 2to3 Python 3 compatibility.
  image_data = opener.open(url).read().decode('utf-8')
  image = {
      'type': 'IMAGE',
      'data': image_data,
      'xsi_type': 'Image'
  }

  return media_service.upload(image)[0]

def _CreateDynamicDisplayAdSettings(media_service, opener):
  """Creates settings for dynamic display ad.

  Args:
    media_service: a SudsServiceProxy instance for AdWords's MediaService.
    opener: an OpenerDirector instance.

  Returns:
    The dynamic display ad settings.
  """
  image = _CreateImage(media_service, opener, 'https://goo.gl/dEvQeF')

  logo = {
      'type': 'IMAGE',
      'mediaId': image['mediaId'],
      'xsi_type': 'Image'
  }

  dynamic_settings = {
      'landscapeLogoImage': logo,
      'pricePrefix': 'as low as',
      'promoText': 'Free shipping!',
      'xsi_type': 'DynamicSettings',
  }

  return dynamic_settings

PHP

public static function runExample(
    AdWordsServices $adWordsServices,
    AdWordsSession $session,
    $adGroupId
) {
    $mediaService = $adWordsServices->get($session, MediaService::class);
    $adGroupAdService = $adWordsServices->get($session, AdGroupAdService::class);

    $operations = [];
    // Create a responsive display ad.
    $responsiveDisplayAd = new ResponsiveDisplayAd();

    // This ad format does not allow the creation of an image using the
    // Image.data field. An image must first be created using the MediaService,
    // and Image.mediaId must be populated when creating the ad.
    $adImage = self::uploadImage($mediaService, 'http://goo.gl/3b9Wfh');
    $marketingImage = new Image();
    $marketingImage->setMediaId($adImage->getMediaId());
    $responsiveDisplayAd->setMarketingImage($marketingImage);

    $responsiveDisplayAd->setShortHeadline('Travel');
    $responsiveDisplayAd->setLongHeadline('Travel the World');
    $responsiveDisplayAd->setDescription('Take to the air!');
    $responsiveDisplayAd->setBusinessName('Google');
    $responsiveDisplayAd->setFinalUrls(['http://www.example.com']);

    // Optional: Create a square marketing image using MediaService, and set it
    // to the ad.
    $squareImage = self::uploadImage($mediaService, 'https://goo.gl/mtt54n');
    $squareMarketingImage = new Image();
    $squareMarketingImage->setMediaId($squareImage->getMediaId());
    $responsiveDisplayAd->setSquareMarketingImage($squareMarketingImage);

    // Optional: Set call to action text.
    $responsiveDisplayAd->setCallToActionText('Shop Now');

    // Optional: Set dynamic display ad settings, composed of landscape logo
    // image, promotion text, and price prefix.
    $dynamicSettings = self::createDynamicDisplayAdSettings($mediaService);
    $responsiveDisplayAd->setDynamicDisplayAdSettings($dynamicSettings);

    // Whitelisted accounts only: Set color settings using hexadecimal values.
    // Set allowFlexibleColor to false if you want your ads to render by always
    // using your colors strictly.
    /*
    $responsiveDisplayAd->setMainColor('#0000ff');
    $responsiveDisplayAd->setAccentColor('#ffff00');
    $responsiveDisplayAd->setAllowFlexibleColor(false);
    */

    // Whitelisted accounts only: Set the format setting that the ad will be
    // served in.
    /*
    $responsiveDisplayAd->setFormatSetting(DisplayAdFormatSetting::NON_NATIVE);
    */

    // Create ad group ad.
    $adGroupAd = new AdGroupAd();
    $adGroupAd->setAdGroupId($adGroupId);
    $adGroupAd->setAd($responsiveDisplayAd);
    // Optional: Set additional settings.
    $adGroupAd->setStatus(AdGroupAdStatus::PAUSED);

    // Create ad group ad operation and add it to the list.
    $operation = new AdGroupAdOperation();
    $operation->setOperand($adGroupAd);
    $operation->setOperator(Operator::ADD);
    $operations[] = $operation;

    // Add a responsive display ad on the server.
    $result = $adGroupAdService->mutate($operations);

    // Create the responsive display ad on the server and print out some
    // information for each created responsive display ad.
    foreach ($result->getValue() as $adGroupAd) {
        printf(
            "Responsive display ad with ID %d and short headline '%s' was added.\n",
            $adGroupAd->getAd()->getId(),
            $adGroupAd->getAd()->getShortHeadline()
        );
    }
}

private static function uploadImage(MediaService $mediaService, $url)
{
    // Creates an image and upload it to the server.
    $image = new Image();
    $image->setData(file_get_contents($url));
    $image->setType(MediaMediaType::IMAGE);

    return $mediaService->upload([$image])[0];
}

private static function createDynamicDisplayAdSettings(
    MediaService $mediaService
) {
    $logoImage = self::uploadImage($mediaService, 'https://goo.gl/dEvQeF');
    $logo = new Image();
    $logo->setMediaId($logoImage->getMediaId());

    $dynamicSettings = new DynamicSettings();
    $dynamicSettings->setLandscapeLogoImage($logo);
    $dynamicSettings->setPricePrefix('as low as');
    $dynamicSettings->setPromoText('Free shipping!');

    return $dynamicSettings;
}

Perl

sub add_responsive_display_ad {
  my ($client, $ad_group_id) = @_;

  # This ad format does not allow the creation of an image using the
  # Image.data field. An image must first be created using the MediaService,
  # and Image.mediaId must be populated when creating the ad.
  my $ad_image = _upload_image($client, "http://goo.gl/3b9Wfh");
  my $marketing_image = Google::Ads::AdWords::v201802::Image->new(
    {mediaId => $ad_image->get_mediaId()});

  # Create the responsive display ad.
  my $responsive_display_ad =
    Google::Ads::AdWords::v201802::ResponsiveDisplayAd->new({
      marketingImage => $marketing_image,
      shortHeadline  => "Travel",
      longHeadline   => "Travel the World",
      description    => "Take to the air!",
      businessName   => "Interplanetary Cruises",
      finalUrls      => ["http://www.example.com/"],
    });

  # Optional: Create a square marketing image using MediaService, and set it
  # to the ad.
  my $square_image = _upload_image($client, "https://goo.gl/mtt54n");
  my $square_marketing_image = Google::Ads::AdWords::v201802::Image->new(
    {mediaId => $square_image->get_mediaId()});
  $responsive_display_ad->set_squareMarketingImage($square_marketing_image);

  # Optional: Set call to action text.
  $responsive_display_ad->set_callToActionText("Shop Now");

  # Optional: Set dynamic display ad settings, composed of landscape logo
  # image, promotion text, and price prefix.
  my $dynamic_settings = _create_dynamic_display_ad_settings($client);
  $responsive_display_ad->set_dynamicDisplayAdSettings($dynamic_settings);

  # Whitelisted accounts only: Set color settings using hexadecimal values.
  # Set allowFlexibleColor to false if you want your ads to render by always
  # using your colors strictly.
  # $responsiveDisplayAd->set_mainColor("#0000ff");
  # $responsiveDisplayAd->set_accentColor("#ffff00");
  # $responsiveDisplayAd->set_allowFlexibleColor(0);

  # Whitelisted accounts only: Set the format setting that the ad will be
  # served in.
  # $responsiveDisplayAd->set_formatSetting("NON_NATIVE");

  # Create ad group ad for the responsive display ad.
  my $responsive_display_ad_group_ad =
    Google::Ads::AdWords::v201802::AdGroupAd->new({
      adGroupId => $ad_group_id,
      ad        => $responsive_display_ad,
      # Additional properties (non-required).
      status => "PAUSED"
    });

  # Create operation.
  my $responsive_display_ad_group_ad_operation =
    Google::Ads::AdWords::v201802::AdGroupAdOperation->new({
      operator => "ADD",
      operand  => $responsive_display_ad_group_ad
    });

  # Add responsive display ad.
  my $result =
    $client->AdGroupAdService()
    ->mutate({operations => [$responsive_display_ad_group_ad_operation]});

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

  return 1;
}

sub _upload_image {
  my ($client, $url) = @_;

  # Creates an image and upload it to the server.
  my $image_data = Google::Ads::Common::MediaUtils::get_base64_data_from_url(
    $url);
  my $image = Google::Ads::AdWords::v201802::Image->new({
      data => $image_data,
      type => "IMAGE"
  });

  return $client->MediaService()->upload({media => [$image]});
}

sub _create_dynamic_display_ad_settings {
  my ($client) = @_;

  my $logo_image = _upload_image($client, 'https://goo.gl/dEvQeF');
  my $logo = Google::Ads::AdWords::v201802::Image->new({
      mediaId => $logo_image->get_mediaId(),
  });

  my $dynamic_settings = Google::Ads::AdWords::v201802::DynamicSettings->new({
    landscapeLogoImage => $logo,
    pricePrefix => "as low as",
    promoText => "Free shipping!"
  });

  return $dynamic_settings;
}

Ruby

def add_responsive_display_ad(adwords, ad_group_id)
  ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION)

  # This ad format does not allow the creation of an image using the Image.data
  # field. An image must first be created using the MediaService, and
  # Image.mediaId must be populated when creating the ad.
  ad_image = upload_image(adwords, 'https://goo.gl/3b9Wfh')

  # Create the responsive display ad.
  responsive_display_ad = {
    :xsi_type => 'ResponsiveDisplayAd',
    # This ad format does not allow the creation of an image using the
    # Image.data field. An image must first be created using the MediaService,
    # and Image.mediaId must be populated when creating the ad.
    :marketing_image => {:media_id => ad_image[:media_id]},
    :short_headline => 'Travel',
    :long_headline => 'Traver the World',
    :description => 'Take to the air!',
    :business_name => 'Interplanetary Cruises',
    :final_urls => ['http://www.example.com/'],

    # Optional: Set call to action text.
    :call_to_action_text => 'Shop Now'

    # Whitelisted accounts only: Set color settings using hexadecimal values.
    # Set 'allow_flexible_color' to false if you want your ads to render by
    # always using your colors strictly.
    #:main_color => '#0000ff',
    #:accent_color => '#ffff00',
    #:allow_flexible_color => false,

    # Whitelisted accounts only: Set the format setting that the ad will be
    # served in.
    #:format_setting => 'NON_NATIVE'
  }

  # Optional: Create a square marketing image using MediaService, and set it to
  # the ad.
  square_image = upload_image(adwords, 'https://goo.gl/mtt54n')
  responsive_display_ad[:square_marketing_image] = {
    :media_id => square_image[:media_id]
  }

  # Optional: Set dynamic display ad settings, composed of landscape logo image,
  # promotion text, and price prefix.
  logo_image = upload_image(adwords, 'https://goo.gl/dEvQeF')
  responsive_display_ad[:dynamic_display_ad_settings] = {
    :landscape_logo_image => {:media_id => logo_image[:media_id]},
    :price_prefix => 'as low as',
    :promo_text => 'Free shipping!'
  }

  # Create an ad group ad for the responsive display ad.
  responsive_display_ad_group_ad = {
    :ad_group_id => ad_group_id,
    :ad => responsive_display_ad,
    # Additional propertires (non-required).
    :status => 'PAUSED'
  }

  # Create operation.
  responsive_display_ad_group_ad_operations = {
    :operator => 'ADD',
    :operand => responsive_display_ad_group_ad
  }

  # Add the responsive display ad.
  result = ad_group_ad_srv.mutate([responsive_display_ad_group_ad_operations])

  # Display results.
  if result && result[:value]
    result[:value].each do |ad_group_ad|
      puts ("New responsive display ad with id %d and short headline '%s' was" +
          "added.") % [ad_group_ad[:ad][:id], ad_group_ad[:ad][:short_headline]]
    end
  else
    puts 'No responsive display ads were added.'
  end
end

def upload_image(adwords, image_url)
  media_srv = adwords.service(:MediaService, API_VERSION)

  # Create an image.
  raw_image_data = AdsCommon::Http.get(image_url, adwords.config)
  image = {
    :xsi_type => 'Image',
    :data => Base64.encode64(raw_image_data),
    :type => 'IMAGE'
  }

  # Upload the image.
  response = media_srv.upload([image])
  if response and !response.empty?
    return response.first
  else
    raise StandardError, 'Could not upload image, aborting.'
  end
end

レスポンシブ広告は、Google ディスプレイ ネットワークを対象とするキャンペーンでのみ掲載されます。キャンペーンの advertisingChannelTypeDISPLAY が設定されていることを確認してください。AdWords 管理画面では、このキャンペーンは「ディスプレイ ネットワークのみ - すべての機能」として表示されます。

ホワイトリストに登録されたお客様のみの機能

以下の機能は、ホワイトリストに登録されたお客様のみ利用できます。

色の管理機能
mainColoraccentColor を指定することで、レスポンシブ ディスプレイ広告の色をカスタマイズして、自分のブランドニーズに合わせることができます。必要に応じて、指定した色と異なる色で広告を配信する場合は、allowFlexibleColortrue に設定します。
ディスプレイ広告フォーマット

レスポンシブ広告は、ネイティブ フォーマットと非ネイティブ フォーマットの両方で実行できます。これらの 2 つのフォーマットの違いは、ネイティブ フォーマットのレンダリングはサイト運営者によって制御される一方、非ネイティブ フォーマットのレンダリングは広告主の入力(たとえば、mainColoraccentColor のカラー情報など)を使用して Google モデルによって最適化されることです。

formatSetting フィールドを設定して、広告が掲載されるフォーマットを選択することができます。ただし、ネイティブフォーマットの場合はサイト運営者が色を制御する必要があるため、allowFlexibleColorfalse の場合 formatSettingNATIVE に設定することはできません。

仕様

マーケティング画像とロゴ画像は、次のサイズ仕様を満たしている必要があります。

  • マーケティング画像

    • 最小サイズ: 600×314 ピクセル

    • 最小サイズ以上にする場合: 1.91:1 の比率の誤差 1% 以内

    • 推奨サイズ: 1,200×628 ピクセル

    • 最大ファイルサイズ: 1 MB(1,048,576 バイト)

  • ロゴ画像(省略可)

    • 最小サイズ: 128×128 ピクセル

    • 最小サイズ以上にする場合: 1:1 の比率の誤差 1% 以内

    • 推奨サイズ: 1,200×1,200 ピクセル

    • 最大ファイルサイズ: 1 MB(1,048,576 バイト)

  • 横向きのロゴ画像

    • 最小サイズ: 512×128 ピクセル

    • 最小サイズ以上にする場合: 4:1 の比率の誤差 1% 以内

    • 推奨サイズ: 1,200×300 ピクセル

    • 最大ファイルサイズ: 1 MB(1,048,576 バイト)

  • スクエアのマーケティング画像

    • 最小サイズ: 300×300 ピクセル

    • 最小サイズ以上にする場合: 1:1 の比率の誤差 1% 以内

    • 推奨サイズ: 1,200×1,200 ピクセル

    • 最大ファイルサイズ: 1 MB(1,048,576 バイト)

レポート

レスポンシブ広告のレポートでは AdTypeRESPONSIVE_DISPLAY_AD となります。

AD_PERFORMANCE_REPORT には、次のようなレスポンシブ広告に固有のフィールドがあります。

アップグレードのヒント

この新しい広告フォーマットはテスト アカウントですぐにでもお試しいただけます。標準のテキスト広告からディスプレイ ネットワーク向けのレスポンシブ広告にアップグレードする場合は、次の手順を行ってください。

  1. PAUSED 状態の新しいレスポンシブ広告を作成します。

  2. 新しいレスポンシブ広告の approvalStatusAPPROVED になるのを待ちます。

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

    • 新しいレスポンシブ広告の statusENABLED に設定する。
    • 以前の標準テキスト広告の statusDISABLED に設定する。

その他の一般的なヒントについては、効果的なディスプレイ広告を作成するためのヒントテキスト広告に基づいて独自のディスプレイ広告を作成するのセクションをご覧ください。

コードサンプル

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

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