コンバージョン管理

Google 広告では、広告インタラクションに続く価値のあるユーザー アクション(商品の購入、リードフォームの送信、ビジネスへの電話、実店舗への来店など)をコンバージョンと呼びます。コンバージョン トラッキングでは、これらの顧客インタラクションを測定して、キャンペーンのパフォーマンスを評価し、自動入札を最適化できます。

Google Ads API を使用すると、コンバージョン アクションの構成、オフライン コンバージョン イベントのインポート、記録されたコンバージョンの拡張または調整、アクションの入札目標とライフサイクル目標へのグループ化、アップロード診断のモニタリングをプログラムで行うことができます。

コンバージョン ワークフローを選択する

次の表を使用して、ユースケースの ConversionActionType、API サービス、実装ガイドを特定します。

タスク コンバージョン アクションの種類 API サービスまたはリソース 実装ガイド
アカウント設定を確認してコンバージョン アクションを作成する UPLOAD_CLICKS、WEBPAGE、UPLOAD_CALLS、AD_CALL、WEBSITE_CALL、GOOGLE_PLAY_DOWNLOAD、GOOGLE_PLAY_IN_APP_PURCHASE Customer (ConversionTrackingSetting)、 ConversionActionService スタートガイドとコンバージョン アクションのカテゴリ
オフライン クリック コンバージョンまたはリードの拡張コンバージョンをインポートする UPLOAD_CLICKS ConversionUploadService.UploadClickConversions(新しい統合の場合は Data Manager API) オフライン クリック コンバージョンをインポートする
オンライン コンバージョンを強化する(拡張コンバージョン(ウェブ向け)) WEBPAGE ConversionAdjustmentUploadService.UploadConversionAdjustments (ENHANCEMENT) オンライン クリック コンバージョンをインポートする
通話コンバージョンのデータをインポートする UPLOAD_CALLS ConversionUploadService.UploadCallConversions 通話コンバージョンのインポート
店舗販売の取引をインポートする STORE_SALES、STORE_SALES_DIRECT_UPLOAD OfflineUserDataJobService(または Data Manager API) 店舗販売コンバージョンをインポートする
記録されたコンバージョンを撤回または修正する UPLOAD_CLICKS、WEBPAGE、SALESFORCE(非推奨) ConversionAdjustmentUploadService.UploadConversionAdjustments (RETRACTION、RESTATEMENT) インポート後にコンバージョンを調整する
カスタムタグのメタデータをコンバージョンに添付する UPLOAD_CLICKS、UPLOAD_CALLS、WEBPAGE ConversionCustomVariableService カスタム コンバージョン変数
入札目標、ライフサイクル目標、価値のルールを設定する アカウント、キャンペーン、ライフサイクル目標 CustomerConversionGoalService、CampaignConversionGoalService、CustomConversionGoalService、ConversionGoalCampaignConfigService、GoalService、CampaignGoalConfigService、ConversionValueRuleService コンバージョン目標、ライフサイクル目標、コンバージョン値のルール
インポートの健全性とエラー診断をモニタリングする UPLOAD_CLICKS、WEBPAGE、UPLOAD_CALLS offline_conversion_upload_client_summary、offline_conversion_upload_conversion_action_summary オフライン データの診断をモニタリングする
コンバージョン指標をクエリしてエラーをトラブルシューティングする すべてのコンバージョンの種類 GoogleAdsService.SearchStream (customer、campaign、 conversion_action) コンバージョン統計情報を取得する、コンバージョンのインポートに関するトラブルシューティング

エンドツーエンドのコンバージョン ライフサイクル

Google Ads API でのコンバージョン管理の統合は、次の 4 つの段階に分かれています。

  1. アカウント設定を確認してコンバージョン アクションを作成する: Customer.conversion_tracking_setting をクエリして、有効なコンバージョン アカウント(google_ads_conversion_customer)を確認し、コンバージョン トラッキングが有効であることを確認して、ユーザーの同意を設定し、ターゲット ConversionActionType と ConversionActionCategory を使用して ConversionAction を作成します。
  2. コンバージョン イベントをインポートする: partial_failure を true に設定した ConversionUploadService を使用してオフラインのクリック コンバージョンまたは通話コンバージョンをストリーミングする、ConversionAdjustmentUploadService を使用して ENHANCEMENT 調整でウェブサイト コンバージョンを補完する、OfflineUserDataJobService を使用して店舗販売を一括アップロードする。
  3. コンバージョンの調整と最適化: ConversionAdjustmentUploadService を使用して、記録されたコンバージョンの取り消しや修正、ConversionCustomVariable メタデータの追加、コンバージョン値のルールの適用、アクションのコンバージョン目標とライフサイクル目標への整理を行い、入札の最適化を管理します。
  4. 診断をモニタリングしてパフォーマンスをレポートする: offline_conversion_upload_client_summary と offline_conversion_upload_conversion_action_summary をクエリして、アップロード処理のステータスと部分的な失敗のアラートを検査します。customer リソースまたは campaign リソース(必要に応じて segments.conversion_action でセグメント化)をクエリして、metrics.conversions 指標と metrics.all_conversions 指標を比較します。または、conversion_action リソースをクエリして、metrics.all_conversions と最後のコンバージョンのタイムスタンプを調べます。

クイックスタート: 設定の確認、アクションの作成、健全性の確認

次の例は、コンバージョン トラッキングの初期化とモニタリングに必要な、最も一般的な 3 つのクエリとミューテーションを示しています。

1. GAQL でコンバージョン トラッキングの設定を確認する

ConversionAction を作成したり、イベントをアップロードしたりする前に、GoogleAdsService.SearchStream を使用して customer リソースをクエリし、コンバージョンを管理するアカウント(google_ads_conversion_customer)、顧客データに関する規約に同意しているかどうか、アカウント単位の拡張コンバージョンが有効になっているかどうか(EnhancedConversionsConfig)を確認します。

SELECT
  customer.conversion_tracking_setting.conversion_tracking_id,
  customer.conversion_tracking_setting.conversion_tracking_status,
  customer.conversion_tracking_setting.cross_account_conversion_tracking_id,
  customer.conversion_tracking_setting.google_ads_conversion_customer,
  customer.conversion_tracking_setting.accepted_customer_data_terms,
  customer.conversion_tracking_setting.enablement_setting,
  customer.conversion_tracking_setting.effective_enablement_setting
FROM customer

google_ads_conversion_customer で返された customers/{customer_id} リソース名から {customer_id} を抽出し、そのお客様 ID に対して後続のすべての ConversionActionService リクエストと ConversionUploadService リクエストを発行します。設定とクロスアカウント階層の詳細については、スタートガイドをご覧ください。

2. コンバージョン アクションを作成する

ConversionActionService.MutateConversionActions を使用して ConversionAction を作成します。次の例では、カスタム値とルックバック設定を使用して UPLOAD_CLICKS コンバージョン アクションを作成します。

Java

private void runExample(GoogleAdsClient googleAdsClient, long customerId) {

  // Creates a ConversionAction.
  ConversionAction conversionAction =
      ConversionAction.newBuilder()
          // Note that conversion action names must be unique. If a conversion action already
          // exists with the specified conversion_action_name the create operation will fail with
          // a ConversionActionError.DUPLICATE_NAME error.
          .setName("Earth to Mars Cruises Conversion #" + getPrintableDateTime())
          .setCategory(ConversionActionCategory.DEFAULT)
          .setType(ConversionActionType.WEBPAGE)
          .setStatus(ConversionActionStatus.ENABLED)
          .setViewThroughLookbackWindowDays(15L)
          .setValueSettings(
              ValueSettings.newBuilder()
                  .setDefaultValue(23.41)
                  .setAlwaysUseDefaultValue(true)
                  .build())
          .build();

  // Creates the operation.
  ConversionActionOperation operation =
      ConversionActionOperation.newBuilder().setCreate(conversionAction).build();

  try (ConversionActionServiceClient conversionActionServiceClient =
      googleAdsClient.getLatestVersion().createConversionActionServiceClient()) {
    MutateConversionActionsResponse response =
        conversionActionServiceClient.mutateConversionActions(
            Long.toString(customerId), Collections.singletonList(operation));
    System.out.printf("Added %d conversion actions:%n", response.getResultsCount());
    for (MutateConversionActionResult result : response.getResultsList()) {
      System.out.printf(
          "New conversion action added with resource name: '%s'%n", result.getResourceName());
    }
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId)
{
    // Get the ConversionActionService.
    ConversionActionServiceClient conversionActionService =
        client.GetService(Services.V26.ConversionActionService);

    // Note that conversion action names must be unique.
    // If a conversion action already exists with the specified name the create operation
    // will fail with a ConversionAction.DUPLICATE_NAME error.
    string ConversionActionName = "Earth to Mars Cruises Conversion #"
        + ExampleUtilities.GetRandomString();

    // Add a conversion action.
    ConversionAction conversionAction = new ConversionAction()
    {
        Name = ConversionActionName,
        Category = ConversionActionCategory.Default,
        Type = ConversionActionType.Webpage,
        Status = ConversionActionStatus.Enabled,
        ViewThroughLookbackWindowDays = 15,
        ValueSettings = new ConversionAction.Types.ValueSettings()
        {
            DefaultValue = 23.41,
            AlwaysUseDefaultValue = true
        }
    };

    // Create the operation.
    ConversionActionOperation operation = new ConversionActionOperation()
    {
        Create = conversionAction
    };

    try
    {
        // Create the conversion action.
        MutateConversionActionsResponse response =
            conversionActionService.MutateConversionActions(customerId.ToString(),
                    new ConversionActionOperation[] { operation });

        // Display the results.
        foreach (MutateConversionActionResult newConversionAction in response.Results)
        {
            Console.WriteLine($"New conversion action with resource name = " +
                $"'{newConversionAction.ResourceName}' was added.");
        }
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}
      

PHP

    public static function runExample(GoogleAdsClient $googleAdsClient, int $customerId)
    {
        // Creates a conversion action.
        $conversionAction = new ConversionAction(
            [
            // Note that conversion action names must be unique.
            // If a conversion action already exists with the specified conversion_action_name
            // the create operation will fail with a ConversionActionError.DUPLICATE_NAME error.
            'name' => 'Earth to Mars Cruises Conversion #' . Helper::getPrintableDatetime(),
            'category' => ConversionActionCategory::PBDEFAULT,
            'type' => ConversionActionType::WEBPAGE,
            'status' => ConversionActionStatus::ENABLED,
            'view_through_lookback_window_days' => 15,
            'value_settings' => new ValueSettings(
                [
                'default_value' => 23.41,
                'always_use_default_value' => true
                ]
            )
            ]
        );

        // Creates a conversion action operation.
        $conversionActionOperation = new ConversionActionOperation();
        $conversionActionOperation->setCreate($conversionAction);

        // Issues a mutate request to add the conversion action.
        $conversionActionServiceClient = $googleAdsClient->getConversionActionServiceClient();
        $response = $conversionActionServiceClient->mutateConversionActions(
            MutateConversionActionsRequest::build($customerId, [$conversionActionOperation])
        );

        printf("Added %d conversion actions:%s", $response->getResults()->count(), PHP_EOL);

        foreach ($response->getResults() as $addedConversionAction) {
            /**
 * @var ConversionAction $addedConversionAction
*/
            printf(
                "New conversion action added with resource name: '%s'%s",
                $addedConversionAction->getResourceName(),
                PHP_EOL
            );
        }
    }
      

Python

def main(client: GoogleAdsClient, customer_id: str) -> None:
    conversion_action_service: ConversionActionServiceClient = (
        client.get_service("ConversionActionService")
    )

    # Create the operation.
    conversion_action_operation: ConversionActionOperation = client.get_type(
        "ConversionActionOperation"
    )

    # Create conversion action.
    conversion_action: ConversionAction = conversion_action_operation.create

    # Note that conversion action names must be unique. If a conversion action
    # already exists with the specified conversion_action_name, the create
    # operation will fail with a ConversionActionError.DUPLICATE_NAME error.
    conversion_action.name = f"Earth to Mars Cruises Conversion {uuid.uuid4()}"
    conversion_action.type_ = (
        client.enums.ConversionActionTypeEnum.UPLOAD_CLICKS
    )
    conversion_action.category = (
        client.enums.ConversionActionCategoryEnum.DEFAULT
    )
    conversion_action.status = client.enums.ConversionActionStatusEnum.ENABLED
    conversion_action.view_through_lookback_window_days = 15

    # Create a value settings object.
    value_settings: ConversionAction.ValueSettings = (
        conversion_action.value_settings
    )
    value_settings.default_value = 15.0
    value_settings.always_use_default_value = True

    # Add the conversion action.
    conversion_action_response: MutateConversionActionsResponse = (
        conversion_action_service.mutate_conversion_actions(
            customer_id=customer_id,
            operations=[conversion_action_operation],
        )
    )

    print(
        "Created conversion action "
        f'"{conversion_action_response.results[0].resource_name}".'
    )
      

Ruby

def add_conversion_action(customer_id)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new


  # Add a conversion action.
  conversion_action = client.resource.conversion_action do |ca|
    ca.name = "Earth to Mars Cruises Conversion #{(Time.new.to_f * 100).to_i}"
    ca.type = :UPLOAD_CLICKS
    ca.category = :DEFAULT
    ca.status = :ENABLED
    ca.view_through_lookback_window_days = 15

    # Create a value settings object.
    ca.value_settings = client.resource.value_settings do |vs|
      vs.default_value = 15
      vs.always_use_default_value = true
    end
  end

  # Create the operation.
  conversion_action_operation = client.operation.create_resource.conversion_action(conversion_action)

  # Add the ad group ad.
  response = client.service.conversion_action.mutate_conversion_actions(
    customer_id: customer_id,
    operations: [conversion_action_operation],
  )

  puts "New conversion action with resource name = #{response.results.first.resource_name}."
end
      

Perl

sub add_conversion_action {
  my ($api_client, $customer_id) = @_;

  # Note that conversion action names must be unique.
  # If a conversion action already exists with the specified conversion_action_name,
  # the create operation fails with error ConversionActionError.DUPLICATE_NAME.
  my $conversion_action_name = "Earth to Mars Cruises Conversion #" . uniqid();

  # Create a conversion action.
  my $conversion_action =
    Google::Ads::GoogleAds::V26::Resources::ConversionAction->new({
      name                          => $conversion_action_name,
      category                      => DEFAULT,
      type                          => WEBPAGE,
      status                        => ENABLED,
      viewThroughLookbackWindowDays => 15,
      valueSettings                 =>
        Google::Ads::GoogleAds::V26::Resources::ValueSettings->new({
          defaultValue          => 23.41,
          alwaysUseDefaultValue => "true"
        })});

  # Create a conversion action operation.
  my $conversion_action_operation =
    Google::Ads::GoogleAds::V26::Services::ConversionActionService::ConversionActionOperation
    ->new({create => $conversion_action});

  # Add the conversion action.
  my $conversion_actions_response =
    $api_client->ConversionActionService()->mutate({
      customerId => $customer_id,
      operations => [$conversion_action_operation]});

  printf "New conversion action added with resource name: '%s'.\n",
    $conversion_actions_response->{results}[0]{resourceName};

  return 1;
}
      

curl

REST リクエスト

REST で同じ ConversionAction を作成するには、POST リクエストを ConversionActionService.MutateConversionActions に送信します。

POST https://googleads.googleapis.com/v26/customers/{customer_id}/conversionActions:mutate
{
  "operations": [
    {
      "create": {
        "name": "Earth to Mars Cruise Conversion",
        "type": "UPLOAD_CLICKS",
        "category": "DEFAULT",
        "status": "ENABLED",
        "primaryForGoal": true,
        "countingType": "ONE_PER_CLICK",
        "clickThroughLookbackWindowDays": "60",
        "valueSettings": {
          "defaultValue": 23.41,
          "defaultCurrencyCode": "USD",
          "alwaysUseDefaultValue": true
        }
      }
    }
  ]
}

コンバージョン アクションが ENABLED になったら、コンバージョンの発生元のワークフローを使用して、コンバージョン イベントまたは拡張機能をインポートします(コンバージョン イベントをインポートするをご覧ください)。

3. オフライン コンバージョンのアップロードの健全性をモニタリングする

クリック コンバージョン、通話コンバージョン、コンバージョン調整をアップロードしたら、offline_conversion_upload_client_summary をクエリして、最近のアップロード全体におけるジョブのステータス、成功率、保留率、エラーの内訳を確認します。

SELECT
  offline_conversion_upload_client_summary.client,
  offline_conversion_upload_client_summary.status,
  offline_conversion_upload_client_summary.total_event_count,
  offline_conversion_upload_client_summary.successful_event_count,
  offline_conversion_upload_client_summary.success_rate,
  offline_conversion_upload_client_summary.pending_event_count,
  offline_conversion_upload_client_summary.pending_rate,
  offline_conversion_upload_client_summary.last_upload_date_time,
  offline_conversion_upload_client_summary.alerts
FROM offline_conversion_upload_client_summary

コンバージョン アクション単位の診断については、offline_conversion_upload_conversion_action_summary をクエリします(オフライン データの診断をモニタリングするをご覧ください)。特定のエラーコードを解決するには、コンバージョンのインポートに関するトラブルシューティングをご覧ください。

ライフサイクル ステージ別のガイド ディレクトリ

ライフサイクル ステージ別に整理されたコンバージョン管理ガイドの全セットをご覧ください。

1. アカウント設定とコンバージョン アクション

  • コンバージョン アクションのカテゴリ: 適切なコンバージョンの発生元(ウェブサイト(WEBPAGE)、電話(UPLOAD_CALLS、AD_CALL、WEBSITE_CALL)、モバイルアプリ(GOOGLE_PLAY_DOWNLOAD、GOOGLE_PLAY_IN_APP_PURCHASE、Firebase、SKAdNetwork)、Google アナリティクス 4(GOOGLE_ANALYTICS_4_CUSTOM、GOOGLE_ANALYTICS_4_PURCHASE)、オフライン(UPLOAD_CLICKS)、実店舗(STORE_SALES))を選択し、対応する ConversionActionType と API ワークフローにマッピングします。
  • スタートガイド: クライアント ライブラリまたは REST を使用して、ユーザーの同意を構成し、ConversionTrackingSetting を確認し、クロスアカウント コンバージョン トラッキングを設定して、コンバージョン アクションを作成します。

2. コンバージョン イベントをインポートする

3. コンバージョンを調整して最適化する

4. モニタリング、レポート、トラブルシューティング