キャンペーン グループと成果目標

キャンペーンをグループ化して共有の成果目標を設定できます。この機能を使用すると、キャンペーン グループ全体の成果を簡単に確認、予測できます。このガイドでは、キャンペーン グループの使用方法について説明します。

キャンペーン グループを作成する

まず、複数のキャンペーンの全体的な成果をトラッキングできるようにキャンペーン グループを作成します。方法は次のとおりです。

C#

private static CampaignGroup CreateCampaignGroup(AdWordsUser user) {
  using (CampaignGroupService campaignGroupService =
      (CampaignGroupService) user.GetService(AdWordsService.v201802.CampaignGroupService)) {

    // Create the campaign group.
    CampaignGroup campaignGroup = new CampaignGroup();
    campaignGroup.name = "Mars campaign group - " + ExampleUtilities.GetShortRandomString();

    // Create the operation.
    CampaignGroupOperation operation = new CampaignGroupOperation();
    operation.operand = campaignGroup;
    operation.@operator = Operator.ADD;

    try {
      CampaignGroupReturnValue retval = campaignGroupService.mutate(
          new CampaignGroupOperation[] { operation });

      // Display the results.
      CampaignGroup newCampaignGroup = retval.value[0];
      Console.WriteLine("Campaign group with ID = '{0}' and name = '{1}' was created.",
          newCampaignGroup.id, newCampaignGroup.name);
      return newCampaignGroup;
    } catch (Exception e) {
      throw new System.ApplicationException("Failed to add campaign group.", e);
    }
  }
}

Java

private static CampaignGroup createCampaignGroup(
    AdWordsServicesInterface adWordsServices, AdWordsSession session)
    throws RemoteException {
  // Get the CampaignGroupService.
  CampaignGroupServiceInterface campaignGroupService =
      adWordsServices.get(session, CampaignGroupServiceInterface.class);

  // Create the campaign group.
  CampaignGroup campaignGroup = new CampaignGroup();
  campaignGroup.setName("Mars campaign group #" + System.currentTimeMillis());

  // Create the operation.
  CampaignGroupOperation operation = new CampaignGroupOperation();
  operation.setOperand(campaignGroup);
  operation.setOperator(Operator.ADD);

  CampaignGroup newCampaignGroup =
      campaignGroupService.mutate(new CampaignGroupOperation[] {operation}).getValue(0);
  System.out.printf(
      "Campaign group with ID %d and name '%s' was created.%n",
      newCampaignGroup.getId(), newCampaignGroup.getName());

  return newCampaignGroup;
}

Python

# Get the CampaignGroupService.
campaign_group_service = client.GetService('CampaignGroupService',
                                           version='v201802')

# Create the operation.
operations = [{
    'operator': 'ADD',
    # Create the campaign group.
    'operand': {
        'name': 'Mars campaign group #%d' % uuid.uuid4()
    }
}]

campaign_group = campaign_group_service.mutate(operations)['value'][0]
campaign_group_id = campaign_group['id']

# Display the results.
print 'Campaign group with ID "%d" and name "%s" was created.' % (
    campaign_group_id, campaign_group['name'])

PHP

private static function createCampaignGroup(
    AdWordsServices $adWordsServices,
    AdWordsSession $session
) {
    $campaignGroupService = $adWordsServices->get($session, CampaignGroupService::class);

    // Create the campaign group.
    $campaignGroup = new CampaignGroup();
    $campaignGroup->setName('Mars campaign group #' . uniqid());

    // Create the operation.
    $operation = new CampaignGroupOperation();
    $operation->setOperand($campaignGroup);
    $operation->setOperator(Operator::ADD);

    $campaignGroup = $campaignGroupService->mutate([$operation])->getValue()[0];
    printf(
        "Campaign group with ID %d and name '%s' was created.\n",
        $campaignGroup->getId(),
        $campaignGroup->getName()
    );

    return $campaignGroup;
}

Perl

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

  # Create the campaign group.
  my $campaign_group = Google::Ads::AdWords::v201802::CampaignGroup->new({
    name => sprintf("Mars campaign group - #%s", uniqid()),
  });
  # Create the operation.
  my $operation = Google::Ads::AdWords::v201802::CampaignGroupOperation->new({
    operator => "ADD",
    operand  => $campaign_group
  });

  my $result =
    $client->CampaignGroupService()->mutate({operations => [$operation]});

  $campaign_group = $result->get_value()->[0];

  printf(
    "Campaign group with ID %d and name '%s' was created.\n",
    $campaign_group->get_id(),
    $campaign_group->get_name());
  return $campaign_group;
}

Ruby

def create_campaign_group(adwords)
  campaign_group_srv = adwords.service(:CampaignGroupService, API_VERSION)

  campaign_group = {
    :name => "Mars campaign group #%d" % (Time.new.to_f * 1000).to_i
  }

  operation = {
    :operand => campaign_group,
    :operator => 'ADD'
  }

  new_campaign_group = campaign_group_srv.mutate([operation])[:value].first
  puts "Campaign group with ID %d and name '%s' was created." % [
    new_campaign_group[:id],
    new_campaign_group[:name]
  ]

  return new_campaign_group
end

次に、キャンペーンの campaignGroupId フィールドを設定して、トラッキングするキャンペーンをこのキャンペーン グループに追加します。検索キャンペーン、ショッピング キャンペーン、ディスプレイ キャンペーン、動画キャンペーンのいずれの組み合わせも選択できますが、次の制限があります。

  • キャンペーンは 1 つのキャンペーン グループだけに追加できます。
  • 共有予算を使用しているキャンペーンは、キャンペーン グループに追加できません。

C#

private static void AddCampaignsToGroup(AdWordsUser user, long campaignGroupId,
    long[] campaignIds) {
  using (CampaignService campaignService = (CampaignService) user.GetService(
      AdWordsService.v201802.CampaignService)) {

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

    for (int i = 0; i < campaignIds.Length; i++) {
      Campaign campaign = new Campaign();
      campaign.id = campaignIds[i];
      campaign.campaignGroupId = campaignGroupId;

      CampaignOperation operation = new CampaignOperation();
      operation.operand = campaign;
      operation.@operator = Operator.SET;
      operations.Add(operation);
    }

    try {
      CampaignReturnValue retval = campaignService.mutate(operations.ToArray());
      List<long> updatedCampaignIds = new List<long>();
      retval.value.ToList().ForEach(
          updatedCampaign => updatedCampaignIds.Add(updatedCampaign.id));

      // Display the results.
      Console.WriteLine("The following campaign IDs were added to the campaign group " +
        "with ID '{0}':\n\t{1}'", campaignGroupId, string.Join(", ", updatedCampaignIds));
    } catch (Exception e) {
      throw new System.ApplicationException("Failed to add campaigns to campaign group.", e);
    }
  }
}

Java

private static void addCampaignsToGroup(
    AdWordsServicesInterface adWordsServices,
    AdWordsSession session,
    CampaignGroup campaignGroup,
    List<Long> campaignIds)
    throws ApiException, RemoteException {
  // Get the CampaignService.
  CampaignServiceInterface campaignService =
      adWordsServices.get(session, CampaignServiceInterface.class);

  List<CampaignOperation> operations = new ArrayList<>();
  for (Long campaignId : campaignIds) {
    Campaign campaign = new Campaign();
    campaign.setId(campaignId);
    campaign.setCampaignGroupId(campaignGroup.getId());

    CampaignOperation operation = new CampaignOperation();
    operation.setOperand(campaign);
    operation.setOperator(Operator.SET);
    operations.add(operation);
  }

  CampaignReturnValue returnValue =
      campaignService.mutate(operations.toArray(new CampaignOperation[operations.size()]));
  System.out.printf(
      "The following campaign IDs were added to the campaign group with ID %d:%n",
      campaignGroup.getId());
  for (Campaign campaign : returnValue.getValue()) {
    System.out.printf("\t%d%n", campaign.getId());
  }
}

Python

# Get the CampaignService.
campaign_service = client.GetService('CampaignService', version='v201802')

# Create the operations.
operations = [{
    'operator': 'SET',
    'operand': {
        'id': campaign_id,
        'campaignGroupId': campaign_group_id
    }
} for campaign_id in campaign_ids]

campaign_service.mutate(operations)

# Display the results.
print ('The following campaign IDs were added to the campaign group with ID '
       '"%d":\n\t%s' % (campaign_group_id, campaign_ids))

PHP

private static function addCampaignsToGroup(
    AdWordsServices $adWordsServices,
    AdWordsSession $session,
    $campaignGroup,
    $campaignIds
) {
    $campaignService = $adWordsServices->get($session, CampaignService::class);

    $operations = [];
    foreach ($campaignIds as $campaignId) {
        $campaign = new Campaign();
        $campaign->setId($campaignId);
        $campaign->setCampaignGroupId($campaignGroup->getId());

        $operation = new CampaignOperation();
        $operation->setOperand($campaign);
        $operation->setOperator(Operator::SET);
        $operations[] = $operation;
    }

    $campaigns = $campaignService->mutate($operations)->getValue();
    printf(
        "The following campaign IDs were added to the campaign group with ID %d:\n",
        $campaignGroup->getId()
    );
    foreach ($campaigns as $campaign) {
        printf("\t%d\n", $campaign->getId());
    }
}

Perl

sub _add_campaigns_to_group {
  my ($client, $campaign_group_id, $campaign_ids) = @_;

  my @operations = ();
  foreach my $campaign_id (@{$campaign_ids}) {
    my $campaign = Google::Ads::AdWords::v201802::Campaign->new({
      id              => $campaign_id,
      campaignGroupId => $campaign_group_id
    });

    # Create operation.
    my $campaign_operation =
      Google::Ads::AdWords::v201802::CampaignOperation->new({
        operator => "SET",
        operand  => $campaign
      });
    push @operations, $campaign_operation;
  }

  # Add campaigns.
  my $result = $client->CampaignService()->mutate({operations => \@operations});

  # Display campaigns.
  foreach my $campaign (@{$result->get_value()}) {
    printf "Campaign with ID %d was added to campaign group with ID %d.\n",
      $campaign->get_id(), $campaign->get_campaignGroupId();
  }
}

Ruby

def add_campaigns_to_group(adwords, campaign_group, campaign_ids)
  campaign_srv = adwords.service(:CampaignService, API_VERSION)

  operations = campaign_ids.map do |campaign_id|
    {
      :operand => {
        :id => campaign_id,
        :campaign_group_id => campaign_group[:id]
      },
      :operator => 'SET'
    }
  end

  return_value = campaign_srv.mutate(operations)
  puts ("The following campaign IDs were added to the campaign group with " +
      " ID %d:") % campaign_group[:id]
  return_value[:value].each do |campaign|
    puts "\t%d" % campaign[:id]
  end
end

成果目標を作成する

キャンペーン グループを作成したら、1 つ以上の成果目標をキャンペーン グループに追加できます。成果目標を設定すると成果の予測が表示され、目標達成に向けて順調に進んでいるかどうかを確認できます。設定した目標に到達しないと予測される場合は、成果の達成に向けて、キャンペーンの設定を見直すことができます。

以下のコード スニペットは、成果目標を作成する方法を示しています。

C#

private static CampaignGroupPerformanceTarget CreatePerformanceTarget(AdWordsUser user,
    long campaignGroupId) {
  using (CampaignGroupPerformanceTargetService campaignGroupPerformanceTargetService =
      (CampaignGroupPerformanceTargetService) user.GetService(
          AdWordsService.v201802.CampaignGroupPerformanceTargetService)) {

    // Create the performance target.
    CampaignGroupPerformanceTarget campaignGroupPerformanceTarget =
      new CampaignGroupPerformanceTarget();
    campaignGroupPerformanceTarget.campaignGroupId = campaignGroupId;

    PerformanceTarget performanceTarget = new PerformanceTarget();
    // Keep the CPC for the campaigns < $3.
    performanceTarget.efficiencyTargetType = EfficiencyTargetType.CPC_LESS_THAN_OR_EQUAL_TO;
    performanceTarget.efficiencyTargetValue = 3000000;

    // Keep the maximum spend under $50.
    performanceTarget.spendTargetType = SpendTargetType.MAXIMUM;
    Money maxSpend = new Money();
    maxSpend.microAmount = 500000000;
    performanceTarget.spendTarget = maxSpend;

    // Aim for at least 3000 clicks.
    performanceTarget.volumeTargetValue = 3000;
    performanceTarget.volumeGoalType = VolumeGoalType.MAXIMIZE_CLICKS;

    // Start the performance target today, and run it for the next 90 days.
    System.DateTime startDate = System.DateTime.Now;
    System.DateTime endDate = startDate.AddDays(90);

    performanceTarget.startDate = startDate.ToString("yyyyMMdd");
    performanceTarget.endDate = endDate.ToString("yyyyMMdd");

    campaignGroupPerformanceTarget.performanceTarget = performanceTarget;

    // Create the operation.
    CampaignGroupPerformanceTargetOperation operation =
        new CampaignGroupPerformanceTargetOperation();
    operation.operand = campaignGroupPerformanceTarget;
    operation.@operator = Operator.ADD;

    try {
      CampaignGroupPerformanceTargetReturnValue retval =
          campaignGroupPerformanceTargetService.mutate(
              new CampaignGroupPerformanceTargetOperation[] { operation });

      // Display the results.
      CampaignGroupPerformanceTarget newCampaignPerfTarget = retval.value[0];

      Console.WriteLine("Campaign performance target with id = '{0}' was added for " +
          "campaign group ID '{1}'.", newCampaignPerfTarget.id,
          newCampaignPerfTarget.campaignGroupId);
      return newCampaignPerfTarget;
    } catch (Exception e) {
      throw new System.ApplicationException("Failed to create campaign performance target.",
          e);
    }
  }
}

Java

private static void createPerformanceTarget(
    AdWordsServicesInterface adWordsServices, AdWordsSession session, CampaignGroup campaignGroup)
    throws ApiException, RemoteException {
  // Get the CampaignGroupPerformanceTargetService.
  CampaignGroupPerformanceTargetServiceInterface campaignGroupPerformanceTargetService =
      adWordsServices.get(session, CampaignGroupPerformanceTargetServiceInterface.class);

  // Create the performance target.
  CampaignGroupPerformanceTarget campaignGroupPerformanceTarget =
      new CampaignGroupPerformanceTarget();
  campaignGroupPerformanceTarget.setCampaignGroupId(campaignGroup.getId());

  PerformanceTarget performanceTarget = new PerformanceTarget();
  // Keep the CPC for the campaigns < $3.
  performanceTarget.setEfficiencyTargetType(EfficiencyTargetType.CPC_LESS_THAN_OR_EQUAL_TO);
  performanceTarget.setEfficiencyTargetValue(3000000d);

  // Keep the maximum spend under $50.
  performanceTarget.setSpendTargetType(SpendTargetType.MAXIMUM);
  Money maxSpend = new Money();
  maxSpend.setMicroAmount(500000000L);
  performanceTarget.setSpendTarget(maxSpend);

  // Aim for at least 3000 clicks.
  performanceTarget.setVolumeTargetValue(3000L);
  performanceTarget.setVolumeGoalType(VolumeGoalType.MAXIMIZE_CLICKS);

  // Start the performance target today, and run it for the next 90 days.
  DateTime startDate = DateTime.now();
  DateTime endDate = DateTime.now().plusDays(90);

  performanceTarget.setStartDate(startDate.toString("yyyyMMdd"));
  performanceTarget.setEndDate(endDate.toString("yyyyMMdd"));

  campaignGroupPerformanceTarget.setPerformanceTarget(performanceTarget);

  // Create the operation.
  CampaignGroupPerformanceTargetOperation operation =
      new CampaignGroupPerformanceTargetOperation();
  operation.setOperand(campaignGroupPerformanceTarget);
  operation.setOperator(Operator.ADD);

  CampaignGroupPerformanceTarget newCampaignGroupPerformanceTarget =
      campaignGroupPerformanceTargetService
          .mutate(new CampaignGroupPerformanceTargetOperation[] {operation})
          .getValue(0);

  // Display the results.
  System.out.printf(
      "Campaign group performance target with ID %d was added for campaign group ID %d.%n",
      newCampaignGroupPerformanceTarget.getId(),
      newCampaignGroupPerformanceTarget.getCampaignGroupId());
}

Python

# Get the CampaignGroupPerformanceTargetService.
cgpt_service = client.GetService('CampaignGroupPerformanceTargetService',
                                 version='v201802')

# Create the operation.
operations = [{
    'operator': 'ADD',
    # Create the performance target.
    'operand': {
        'campaignGroupId': campaign_group_id,
        'performanceTarget': {
            # Keep the CPC for the campaigns < $3.
            'efficiencyTargetType': 'CPC_LESS_THAN_OR_EQUAL_TO',
            'efficiencyTargetValue': 3000000,
            # Keep the maximum spend under $50.
            'spendTargetType': 'MAXIMUM',
            'spendTarget': {
                'microAmount': 500000000
            },
            # Aim for at least 3000 clicks.
            'volumeGoalType': 'MAXIMIZE_CLICKS',
            'volumeTargetValue': 3000,
            # Start the performance target today, and run it for the next 90
            # days.
            'startDate': datetime.datetime.now().strftime('%Y%m%d'),
            'endDate': (datetime.datetime.now() +
                        datetime.timedelta(90)).strftime('%Y%m%d')
        }
    }
}]

cgpt = cgpt_service.mutate(operations)['value'][0]

# Display the results.
print ('Campaign performance target with ID "%d" was added for campaign '
       'group ID "%d".' % (cgpt['id'], cgpt['campaignGroupId']))

PHP

private static function createPerformanceTarget(
    AdWordsServices $adWordsServices,
    AdWordsSession $session,
    CampaignGroup $campaignGroup
) {
    $campaignGroupPerformanceTargetService = $adWordsServices->get(
        $session,
        CampaignGroupPerformanceTargetService::class
    );

    // Create the performance target.
    $performanceTarget = new PerformanceTarget();
    // Keep the CPC for the campaigns < $3.
    $performanceTarget->setEfficiencyTargetType(
        EfficiencyTargetType::CPC_LESS_THAN_OR_EQUAL_TO
    );
    $performanceTarget->setEfficiencyTargetValue(3000000);

    // Keep the maximum spend under $50.
    $performanceTarget->setSpendTargetType(SpendTargetType::MAXIMUM);
    $maxSpend = new Money();
    $maxSpend->setMicroAmount(500000000);
    $performanceTarget->setSpendTarget($maxSpend);

    // Aim for at least 3000 clicks.
    $performanceTarget->setVolumeTargetValue(3000);
    $performanceTarget->setVolumeGoalType(VolumeGoalType::MAXIMIZE_CLICKS);

    // Start the performance target today, and run it for the next 90 days.
    $startDate = date('Ymd', strtotime('now'));
    $endDate = date('Ymd', strtotime('+90 day'));

    $performanceTarget->setStartDate($startDate);
    $performanceTarget->setEndDate($endDate);

    // Create the campaign group performance target.
    $campaignGroupPerformanceTarget = new CampaignGroupPerformanceTarget();
    $campaignGroupPerformanceTarget->setCampaignGroupId(
        $campaignGroup->getId()
    );
    $campaignGroupPerformanceTarget->setPerformanceTarget($performanceTarget);

    // Create the operation.
    $operation = new CampaignGroupPerformanceTargetOperation();
    $operation->setOperand($campaignGroupPerformanceTarget);
    $operation->setOperator(Operator::ADD);

    $campaignGroupPerformanceTarget = $campaignGroupPerformanceTargetService->mutate([$operation])->getValue()[0];

    // Display the results.
    printf(
        "Campaign group performance target with ID %d was added for campaign group ID %d.\n",
        $campaignGroupPerformanceTarget->getId(),
        $campaignGroupPerformanceTarget->getCampaignGroupId()
    );
}

Perl

sub _create_performance_target {
  my ($client, $campaign_group_id) = @_;

  # Start the performance target today, and run it for the next 90 days.
  my (undef, undef, undef, $mday, $mon, $year) = localtime(time);
  my $start_date = sprintf("%d%02d%02d", ($year + 1900), ($mon + 1), $mday);
  (undef, undef, undef, $mday, $mon, $year) =
    localtime(time + 60 * 60 * 24 * 90);
  my $end_date = sprintf("%d%02d%02d", ($year + 1900), ($mon + 1), $mday);

  my $performance_target =
    Google::Ads::AdWords::v201802::PerformanceTarget->new({
      # Keep the CPC for the campaigns < $3.
      efficiencyTargetType  => "CPC_LESS_THAN_OR_EQUAL_TO",
      efficiencyTargetValue => 3000000,
      # Keep the maximum spend under $50.
      spendTargetType => "MAXIMUM",
      spendTarget =>
        Google::Ads::AdWords::v201802::Money->new({microAmount => 500000000}),
      # Aim for at least 3000 clicks.
      volumeTargetValue => 3000,
      volumeGoalType    => "MAXIMIZE_CLICKS",
      startDate         => $start_date,
      endDate           => $end_date
    });

  # Create the performance target.
  my $campaign_group_performance_target =
    Google::Ads::AdWords::v201802::CampaignGroupPerformanceTarget->new({
      campaignGroupId   => $campaign_group_id,
      performanceTarget => $performance_target
    });
  # Create the operation.
  my $operation =
    Google::Ads::AdWords::v201802::CampaignGroupPerformanceTargetOperation->new(
    {
      operator => "ADD",
      operand  => $campaign_group_performance_target
    });

  my $result =
    $client->CampaignGroupPerformanceTargetService()
    ->mutate({operations => [$operation]});

  $campaign_group_performance_target = $result->get_value()->[0];

  printf(
    "Campaign performance target with ID %d was added for campaign group ID " .
    "%d.\n",
    $campaign_group_performance_target->get_id(),
    $campaign_group_performance_target->get_campaignGroupId());
}

Ruby

def create_performance_target(adwords, campaign_group)
  campaign_group_performance_target_srv = adwords.service(
      :CampaignGroupPerformanceTargetService, API_VERSION)

  campaign_group_performance_target = {
    :campaign_group_id => campaign_group[:id],
    :performance_target => {
      # Keep the CPC for the campaigns <=$3.
      :efficiency_target_type => 'CPC_LESS_THAN_OR_EQUAL_TO',
      :efficiency_target_value => 3_000_000,
      # Keep the maximum spend under $50.
      :spend_target_type => 'MAXIMUM',
      :spend_target => {
        :micro_amount => 50_000_000
      },
      # Aim for at least 3000 clicks.
      :volume_target_value => 3000,
      :volume_goal_type => 'MAXIMIZE_CLICKS',
      # Start the performance target today, and run it for the next 90 days.
      :start_date => DateTime.parse((Date.today).to_s).strftime('%Y%m%d'),
      :end_date => DateTime.parse((Date.today + 90).to_s).strftime('%Y%m%d')
    }
  }

  operation = {
    :operand => campaign_group_performance_target,
    :operator => 'ADD'
  }

  new_campaign_group_performance_target =
      campaign_group_performance_target_srv.mutate([operation])[:value].first

  puts ("Campaign group performance target with ID %s was added for campaign " +
      "group ID %d") % [new_campaign_group_performance_target[:id],
      new_campaign_group_performance_target[:campaign_group_id]]
end

成果目標には次の条件項目が用意されており、クリック数とコンバージョン数のいずれかを重視して設定を行うことができます。

  1. ボリューム: 目標の進捗をレポートする方法を指定します。volumeGoalType はクリック数とコンバージョン数のどちらを使用するかを指定し、volumeTargetValue は指定した期間内に達成を希望する目標を指定します。
  2. 効率性の目標: 成果目標のボリューム目標に制限を設定します(省略可)。通常は費用の観点から行います。efficiencyTargetType は、トラッキングする効率性の指標を指定し、efficiencyTargetValue は効率性の目標値を指定します。
  3. 費用目標: 成果目標の期間中に支払い可能な金額に関する制限を設定します(省略可)。spendTarget は顧客の通貨で金額をマイクロ単位で指定し、spendTargetType はこの金額が最小か最大かを指定します。
  4. 期間: 効率性の目標または費用目標を指定する場合は、目標をトラッキングする期間(startDateendDate)も指定します。

掲載結果のトラッキング

CAMPAIGN_GROUP_PERFORMANCE_REPORT を使用して、キャンペーン グループの掲載結果をトラッキングできます。 個々の成果目標の掲載結果を確認するには、それぞれの forecastStatus フィールドを確認します。forecastStatusACTIVE_NEEDS_ATTENTION を返す場合、そのキャンペーンは目標を達成できない可能性が高いので、ご確認のうえ改善を図ってください。

コードサンプル

キャンペーン グループと成果目標を設定するための完全なコードサンプルは、各クライアント ライブラリでご確認いただけます。

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

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