Melaporkan eksperimen

Ada dua cara utama untuk melaporkan eksperimen:

  • Pelaporan eksperimen langsung: Kueri resource experiment untuk metrik. Opsi ini memberikan metrik untuk grup kontrol dan perlakuan dalam satu respons, beserta data perbandingan statistik seperti peningkatan dan nilai p. Ini adalah satu-satunya cara untuk melaporkan eksperimen dalam kampanye.
  • Pelaporan kampanye: Kueri resource campaign untuk metrik, menggunakan campaign.experiment_type untuk membedakan antara kampanye dasar dan kampanye eksperimen. Opsi ini hanya tersedia untuk eksperimen yang menggunakan kampanye kontrol dan perlakuan terpisah, seperti eksperimen yang dikelola sistem.

Panduan ini berfokus terutama pada pelaporan eksperimen langsung, yang kompatibel dengan semua jenis eksperimen yang mendukung pelaporan.

Pelaporan eksperimen langsung

Anda dapat membuat kueri resource experiment secara langsung untuk mengambil metrik performa dan perbandingan statistik antara grup kontrol dan perlakuan.

Metrik dan signifikansi statistik

Untuk metrik inti seperti klik, tayangan iklan, biaya, konversi, dan nilai konversi, resource experiment memberikan metrik perlakuan (misalnya, metrics.clicks) dan metrik kontrol (misalnya, metrics.control_clicks) dalam baris yang sama.

Laporan ini juga menyediakan kolom untuk membantu Anda mengevaluasi signifikansi statistik dari setiap perbedaan antara grup:

  • metrics.*_p_value: Probabilitas bahwa hasil yang diamati akan terjadi jika eksperimen tidak memiliki efek yang sebenarnya pada metrik. Nilai p yang lebih rendah menunjukkan signifikansi statistik yang lebih tinggi.
  • metrics.*_point_estimate: Perkiraan peningkatan persentase (positif atau negatif) dalam metrik tertentu untuk grup perlakuan dibandingkan dengan grup kontrol. Bersama dengan margin_of_error, keduanya menjelaskan interval kepercayaan dengan tingkat kepercayaan yang ditentukan untuk perbedaan yang diperkirakan. Jumlah yang diperkirakan adalah (perlakuan / kontrol - 1). Estimasi titik adalah pusat interval kepercayaan.
  • metrics.*_margin_of_error: Radius interval kepercayaan, yang dipusatkan di point_estimate. Nilai ini dihitung untuk tingkat kepercayaan yang ditentukan, yang bergantung pada jenis eksperimen.

Kolom metrik inti berikut didukung di resource experiment, termasuk nilai grup perlakuan, nilai grup kontrol, dan kolom statistik yang tercantum sebelumnya:

  • clicks
  • impressions
  • cost_micros
  • conversions
  • cost_per_conversion
  • conversion_value
  • conversion_value_per_cost

Untuk konversi, khususnya, kolom statistik tersedia melalui kolom absolute_change berikut, bukan sebagai nilai relatif:

Untuk mendapatkan bantuan dalam membuat kueri yang valid ke resource experiment, gunakan alat Pembuat Kueri Google Ads.

Contoh kueri

Kueri GAQL berikut mengambil metrik utama untuk eksperimen:

SELECT
  experiment.experiment_id,
  experiment.name,
  experiment.type,
  metrics.clicks,
  metrics.control_clicks,
  metrics.clicks_point_estimate,
  metrics.clicks_margin_of_error,
  metrics.clicks_p_value,
  metrics.conversions,
  metrics.control_conversions,
  metrics.conversions_absolute_change_point_estimate,
  metrics.conversions_absolute_change_margin_of_error,
  metrics.conversions_absolute_change_p_value
FROM experiment
WHERE experiment.experiment_id = EXPERIMENT_ID

Menafsirkan Hasil

Anda dapat menggunakan kolom nilai p, estimasi titik, dan margin error untuk menentukan apakah eksperimen Anda telah menghasilkan hasil yang signifikan secara statistik. Misalnya, jika conversions_absolute_change_p_value berada di bawah nilai minimum yang Anda pilih (misalnya, 0,05 untuk keyakinan 95%) dan conversions_absolute_change_point_estimate - conversions_absolute_change_margin_of_error lebih besar dari nol, hal ini menunjukkan bahwa grup perlakuan berperforma jauh lebih baik daripada grup kontrol dalam hal konversi.

Berikut cuplikan Python yang menunjukkan cara mengevaluasi hasil berdasarkan nilai p dan estimasi peningkatan:

Java

private void evaluateExperiment(
    GoogleAdsClient googleAdsClient, long customerId, GoogleAdsRow row) {
  Metrics metrics = row.getMetrics();
  String experimentResourceName = row.getExperiment().getResourceName();

  // 1. Evaluate conversion success as a primary success signal if available.
  // - Point Estimate: Represents the estimated average lift or difference in conversions.
  // - Margin of Error: Outlines the confidence interval bounds. Note that the margin_of_error
  //   provided by the API is calculated for a preset confidence level which is set based on the
  //   experiment type.
  // - Lower Bound: (Point Estimate - Margin of Error). If this value is above 0,
  //   we have statistical significance that performance has improved.
  double convPValue = metrics.getConversionsAbsoluteChangePValue();
  double convLift = metrics.getConversionsAbsoluteChangePointEstimate();
  double convError = metrics.getConversionsAbsoluteChangeMarginOfError();
  double convLowerBound = convLift - convError;

  if (convPValue <= P_VALUE_THRESHOLD) {
    if (convLowerBound > 0) {
      System.out.printf(
          "Significant Success: Conversions increased. Even at the lower bound, the lift is %.2f."
              + " Promoting changes.%n",
          convLowerBound);
      promoteExperiment(googleAdsClient, customerId, experimentResourceName);
      return;
    } else if ((convLift + convError) < 0) {
      System.out.printf(
          "Significant Decline: Even the upper bound (%.2f) is below zero. Ending experiment.%n",
          convLift + convError);
      endExperiment(googleAdsClient, customerId, experimentResourceName);
      return;
    }
  }

  // 2. Fall back to evaluating click metrics if conversions are inconclusive.
  double clickPValue = metrics.getClicksPValue();
  double clickLift = metrics.getClicksPointEstimate();
  double clickError = metrics.getClicksMarginOfError();
  double clickLowerBound = clickLift - clickError;

  if (clickPValue <= P_VALUE_THRESHOLD && clickLowerBound > 0) {
    System.out.printf("Click volume is significantly up (+%.1f%%).%n", clickLift * 100);

    // Graduation is only supported for separate campaign experiments, not
    // intra-campaign experiments where there is no separate treatment campaign.
    ExperimentType experimentType = row.getExperiment().getType();
    if (experimentType != ExperimentType.ADOPT_BROAD_MATCH_KEYWORDS
        && experimentType != ExperimentType.ADOPT_AI_MAX) {
      System.out.println("Graduating treatment campaign for further manual analysis.");
      graduateExperiment(googleAdsClient, customerId, experimentResourceName);
    } else {
      System.out.println(
          "Intra-campaign trial detected: graduation is not supported. Continuing to run the"
              + " experiment to gather more conversion data.");
    }
  } else {
    // 3. Print status if no action was taken.
    System.out.printf(
        "Inconclusive: No significant lift in Conversions (p=%.2f) or Clicks (p=%.2f). Current"
            + " estimated lift: %.2f +/- %.2f. Allowing the experiment to continue running.%n",
        convPValue, clickPValue, convLift, convError);
  }
}

      

C#

private static void EvaluateExperiment(GoogleAdsClient client, long customerId, GoogleAdsRow row)
{
    // This function evaluates performance metrics and immediately takes action
    // to update the experiment's status (promote, end, or graduate) if
    // statistical significance thresholds are met.
    var metrics = row.Metrics;
    string experimentResourceName = row.Experiment.ResourceName;

    bool hasConvMetrics = metrics.HasConversionsAbsoluteChangePValue
        && metrics.HasConversionsAbsoluteChangePointEstimate
        && metrics.HasConversionsAbsoluteChangeMarginOfError;

    bool hasClickMetrics = metrics.HasClicksPValue
        && metrics.HasClicksPointEstimate
        && metrics.HasClicksMarginOfError;

    // 1. Evaluate conversion success as a primary success signal if available.
    // - Point Estimate: Represents the estimated average lift or difference in conversions.
    // - Margin of Error: Outlines the confidence interval bounds. Note that the margin_of_error
    //   provided by the API is calculated for a preset confidence level which is set based on
    //   the experiment type.
    // - Lower Bound: (Point Estimate - Margin of Error). If this value is above 0,
    //   we have statistical significance that performance has improved.
    if (hasConvMetrics)
    {
        double convPValue = metrics.ConversionsAbsoluteChangePValue;
        double convLift = metrics.ConversionsAbsoluteChangePointEstimate;
        double convError = metrics.ConversionsAbsoluteChangeMarginOfError;
        double convLowerBound = convLift - convError;

        if (convPValue <= P_VALUE_THRESHOLD)
        {
            if (convLowerBound > 0)
            {
                Console.WriteLine(
                    $"Significant Success: Conversions increased. Even at the lower" +
                    $" bound, the lift is {convLowerBound:F2}. Promoting changes.");
                PromoteExperiment(client, customerId, experimentResourceName);
                return;
            }
            else if ((convLift + convError) < 0)
            {
                Console.WriteLine(
                    $"Significant Decline: Even the upper bound ({convLift + convError:F2}) " +
                    $"is below zero. Ending experiment.");
                EndExperiment(client, customerId, experimentResourceName);
                return;
            }
        }
    }

    // 2. Evaluate click volume as a secondary signal.
    // This is helpful as an early indicator or for lower-volume accounts.
    if (hasClickMetrics)
    {
        double clickPValue = metrics.ClicksPValue;
        double clickLift = metrics.ClicksPointEstimate;
        double clickError = metrics.ClicksMarginOfError;
        double clickLowerBound = clickLift - clickError;

        if (clickPValue <= P_VALUE_THRESHOLD && clickLowerBound > 0)
        {
            // We have a directional winner: high confidence in more traffic,
            // but not enough data to confirm conversion impact yet.
            Console.WriteLine(
                $"Click volume is significantly up (+{clickLift * 100:F1}%).");

            // Graduation is only supported for separate campaign experiments, not
            // intra-campaign experiments where there is no separate treatment campaign.
            if (row.Experiment.Type != ExperimentType.AdoptBroadMatchKeywords
                && row.Experiment.Type != ExperimentType.AdoptAiMax)
            {
                Console.WriteLine("Graduating treatment campaign for further manual analysis.");
                GraduateExperiment(client, customerId, experimentResourceName);
            }
            else
            {
                Console.WriteLine(
                    "Intra-campaign trial detected: graduation is not supported. " +
                    "Continuing to run the experiment to gather more conversion data.");
            }
            return;
        }
    }

    // 3. Print status if no action was taken.
    if (hasConvMetrics || hasClickMetrics)
    {
        string convStatus = hasConvMetrics
            ? $"Conversions (p={metrics.ConversionsAbsoluteChangePValue:F2}, " +
              $"lift={metrics.ConversionsAbsoluteChangePointEstimate:F2} +/- " +
              $"{metrics.ConversionsAbsoluteChangeMarginOfError:F2})"
            : "Conversions (not populated)";

        string clickStatus = hasClickMetrics
            ? $"Clicks (p={metrics.ClicksPValue:F2}, " +
              $"lift={metrics.ClicksPointEstimate:F2} +/- " +
              $"{metrics.ClicksMarginOfError:F2})"
            : "Clicks (not populated)";

        Console.WriteLine(
            $"Inconclusive: No significant action taken. {convStatus}, {clickStatus}. " +
            "Allowing the experiment to continue running.");
    }
    else
    {
        Console.WriteLine(
            "Conversion and click performance metrics are not yet populated. " +
            "Allowing the experiment to continue running.");
    }
}
      

PHP

This example is not yet available in PHP; you can take a look at the other languages.
    

Python

def evaluate_experiment(
    client: GoogleAdsClient, customer_id: str, row: GoogleAdsRow
) -> None:
    """Evaluates the performance of the experiment and updates it accordingly
    (for example, promotes, ends, or graduates).

    Checks conversion and click metrics against statistical significance thresholds
    to determine the appropriate action to take on the experiment.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        row: a GoogleAdsRow containing the experiment and metrics.
    """
    # This function evaluates performance metrics and immediately takes action
    # to update the experiment's status (promote, end, or graduate) if
    # statistical significance thresholds are met.
    metrics = row.metrics
    experiment_resource_name = row.experiment.resource_name

    has_conv_metrics = (
        "conversions_absolute_change_p_value" in metrics
        and "conversions_absolute_change_point_estimate" in metrics
        and "conversions_absolute_change_margin_of_error" in metrics
    )
    has_click_metrics = (
        "clicks_p_value" in metrics
        and "clicks_point_estimate" in metrics
        and "clicks_margin_of_error" in metrics
    )

    # 1. Evaluate conversion success as a primary success signal if available.
    # - Point Estimate: Represents the estimated average lift or difference in conversions.
    # - Margin of Error: Outlines the confidence interval bounds. Note that the margin_of_error provided by the API is calculated for a preset confidence level which is set based on the experiment type.
    # - Lower Bound: (Point Estimate - Margin of Error). If this value is above 0,
    #   we have statistical significance that performance has improved.
    if has_conv_metrics:
        conv_p_value = metrics.conversions_absolute_change_p_value
        conv_lift = metrics.conversions_absolute_change_point_estimate
        conv_error = metrics.conversions_absolute_change_margin_of_error
        conv_lower_bound = conv_lift - conv_error

        if conv_p_value <= P_VALUE_THRESHOLD:
            if conv_lower_bound > 0:
                print(
                    "Significant Success: Conversions increased. Even at the lower"
                    f" bound, the lift is {conv_lower_bound:.2f}. Promoting"
                    " changes."
                )
                promote_experiment(
                    client, customer_id, experiment_resource_name
                )
                return
            elif (conv_lift + conv_error) < 0:
                print(
                    "Significant Decline: Even the upper bound"
                    f" ({conv_lift + conv_error:.2f}) is below zero. Ending"
                    " experiment."
                )
                end_experiment(client, customer_id, experiment_resource_name)
                return

        # 2. Evaluate click volume as a secondary signal.
        # This is helpful as an early indicator or for lower-volume accounts.
        click_p_value = metrics.clicks_p_value
        click_lift = metrics.clicks_point_estimate
        click_error = metrics.clicks_margin_of_error
        click_lower_bound = click_lift - click_error

        if click_p_value <= P_VALUE_THRESHOLD and click_lower_bound > 0:
            # We have a directional winner: high confidence in more traffic,
            # but not enough data to confirm conversion impact yet.
            print(f"Click volume is significantly up (+{click_lift*100:.1f}%).")

            # Graduation is only supported for separate campaign experiments, not
            # intra-campaign experiments where there is no separate treatment campaign.
            experiment_type_name = row.experiment.type_.name
            if (
                experiment_type_name != "ADOPT_BROAD_MATCH_KEYWORDS"
                and experiment_type_name != "ADOPT_AI_MAX"
            ):
                print(
                    "Graduating treatment campaign for further manual analysis."
                )
                graduate_experiment(
                    client, customer_id, experiment_resource_name
                )
            else:
                print(
                    "Intra-campaign trial detected: graduation is not supported. "
                    "Continuing to run the experiment to gather more conversion data."
                )
            return

    # 3. Print status if no action was taken.
    if has_conv_metrics or has_click_metrics:
        conv_status = (
            f"Conversions (p={metrics.conversions_absolute_change_p_value:.2f}, "
            f"lift={metrics.conversions_absolute_change_point_estimate:.2f} +/- "
            f"{metrics.conversions_absolute_change_margin_of_error:.2f})"
            if has_conv_metrics
            else "Conversions (not populated)"
        )
        click_status = (
            f"Clicks (p={metrics.clicks_p_value:.2f}, "
            f"lift={metrics.clicks_point_estimate:.2f} +/- "
            f"{metrics.clicks_margin_of_error:.2f})"
            if has_click_metrics
            else "Clicks (not populated)"
        )
        print(
            f"Inconclusive: No significant action taken. {conv_status}, {click_status}."
            " Allowing the experiment to continue running."
        )
    else:
        print(
            "Conversion and click performance metrics are not yet populated. "
            "Allowing the experiment to continue running."
        )
      

Ruby

This example is not yet available in Ruby; you can take a look at the other languages.
    

Perl

This example is not yet available in Perl; you can take a look at the other languages.
    

curl

Manfaat dibandingkan pelaporan kampanye

Pelaporan eksperimen langsung menawarkan beberapa keunggulan dibandingkan dengan membuat kueri laporan kampanye secara terpisah:

  1. Metrik terpusat: Ambil metrik untuk kontrol dan perlakuan dalam satu baris.
  2. Data keyakinan statistik: Memberikan nilai p, estimasi titik, dan margin error yang dihitung.
  3. Efisiensi: Tidak perlu lagi menggabungkan atau membandingkan hasil dari beberapa laporan secara manual.
  4. Dukungan dalam kampanye: Ini adalah satu-satunya cara untuk membandingkan kontrol versus perlakuan untuk eksperimen dalam kampanye, yang memisahkan traffic dalam satu kampanye.

Pelaporan kampanye

Untuk eksperimen yang membuat kampanye perlakuan terpisah (misalnya, SEARCH_CUSTOM), Anda dapat membuat kueri resource campaign dan menggunakan campaign.experiment_type untuk mengidentifikasi kampanye BASE (kontrol) dan EXPERIMENT (perlakuan). Pendekatan ini berguna jika Anda perlu menyegmentasikan metrik pada tingkat yang lebih terperinci (misalnya, menurut grup iklan atau kata kunci) atau melihat metadata kampanye yang tidak tersedia di resource experiment. Namun, Anda harus melakukan perbandingan performa dan penghitungan statistik secara manual.

Anda tidak dapat menggunakan pelaporan tingkat kampanye untuk membandingkan grup eksperimen dalam eksperimen dalam kampanye, karena pembagian traffic terjadi secara internal dalam satu kampanye. Mengirim kueri campaign untuk eksperimen dalam kampanye hanya akan menampilkan total gabungan.

Praktik terbaik

  • Pilih tingkat keyakinan yang sesuai: Menetapkan nilai p-value yang lebih rendah dapat memberikan panduan terarah lebih cepat, terutama dengan anggaran atau volume konversi yang lebih rendah. Keyakinan 95% (nilai p <= 0,05) dianggap sebagai standar akademis dan mungkin lebih baik untuk hasil yang lebih akurat dalam jangka waktu yang lebih lama.
  • Jalankan eksperimen dalam waktu yang cukup lama: Jalankan eksperimen setidaknya selama 4 minggu untuk memperhitungkan siklus performa mingguan, jeda konversi, dan periode pembelajaran.
  • Berikan waktu untuk peningkatan: Untuk kampanye yang menggunakan bidding otomatis atau menguji fitur baru, abaikan data 1-2 minggu pertama untuk memberikan waktu bagi model bidding dan tingkat traffic untuk dikalibrasi ulang sesuai pembagian.
  • Gunakan pembagian 50/50: Pembagian traffic 50/50 umumnya merupakan cara tercepat untuk mendapatkan hasil yang signifikan secara statistik.
  • Jadwalkan terlebih dahulu: Tetapkan tanggal mulai eksperimen Anda 3-7 hari ke depan untuk memberikan waktu bagi proses peninjauan dan persetujuan iklan.
  • Anda hanya dapat menjalankan satu eksperimen per kampanye pada waktu tertentu.