Raport dotyczący eksperymentów

Eksperymenty możesz raportować na 2 główne sposoby:

  • Raportowanie bezpośrednie eksperymentu: wysyłaj zapytania do zasobu experiment o dane. Ta opcja zawiera dane o grupach kontrolnej i eksperymentalnej w jednej odpowiedzi, a także dane porównawcze, takie jak wzrost i wartości p. To jedyny sposób na generowanie raportów o eksperymentach w ramach kampanii.
  • Raportowanie dotyczące kampanii: wysyłaj zapytania do zasobu campaign o dane, używając parametru campaign.experiment_type do rozróżniania kampanii podstawowych i kampanii z eksperymentem. Ta opcja jest dostępna tylko w przypadku eksperymentów, w których używane są oddzielne kampanie kontrolne i eksperymentalne, np. eksperymentów zarządzanych przez system.

Ten przewodnik koncentruje się głównie na raportowaniu bezpośrednim eksperymentów, które jest zgodne ze wszystkimi typami eksperymentów obsługującymi raportowanie.

Raportowanie bezpośrednich eksperymentów

Możesz wysyłać zapytania bezpośrednio do zasobu experiment, aby pobierać dane o skuteczności i porównania statystyczne między grupą kontrolną a eksperymentalną.

Dane i istotność statystyczna

W przypadku podstawowych danych, takich jak kliknięcia, wyświetlenia, koszt, konwersje i wartość konwersji, zasób experiment zawiera w tym samym wierszu dane dotyczące grupy eksperymentalnej (np. metrics.clicks) i grupy kontrolnej (np. metrics.control_clicks).

Zawiera też pola, które pomagają ocenić istotność statystyczną różnic między grupami:

  • metrics.*_p_value: prawdopodobieństwo, że zaobserwowane wyniki wystąpiłyby, gdyby eksperyment nie miał rzeczywistego wpływu na wskaźnik. Im niższa wartość p, tym wyższa istotność statystyczna.
  • metrics.*_point_estimate: szacunkowy procentowy wzrost (dodatni lub ujemny) danego wskaźnika w grupie eksperymentalnej w porównaniu z grupą kontrolną. Wraz z wartością margin_of_error opisują przedział ufności o określonym poziomie ufności dla szacowanej różnicy. Szacowana wielkość to (grupa eksperymentalna / grupa kontrolna – 1). Szacunek punktowy to środek przedziału ufności.
  • metrics.*_margin_of_error: promień przedziału ufności, który jest wyśrodkowany na wartości point_estimate. Jest on obliczany dla określonego poziomu ufności, który zależy od typu eksperymentu.

W przypadku zasobu experiment obsługiwane są te pola podstawowych danych, w tym wartość grupy eksperymentalnej, wartość grupy kontrolnej i pola statystyczne wymienione wcześniej:

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

W przypadku konwersji pola statystyczne są dostępne w tych absolute_change polach, a nie jako wartości względne:

Aby uzyskać pomoc w tworzeniu prawidłowych zapytań do zasobu experiment, użyj narzędzia Kreator zapytań Google Ads.

Przykładowe zapytanie

To zapytanie GAQL pobiera kluczowe dane eksperymentu:

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

Interpretowanie wyników

Aby sprawdzić, czy eksperyment przyniósł istotne statystycznie wyniki, możesz użyć pól wartości p, szacunkowej wartości punktowej i zakresu błędu. Jeśli na przykład wartość conversions_absolute_change_p_value jest niższa od wybranego progu (np.0,05 w przypadku przedziału ufności 95%), a wartość conversions_absolute_change_point_estimate – conversions_absolute_change_margin_of_error jest większa od zera, oznacza to, że kampania eksperymentalna uzyskuje znacznie lepsze wyniki niż kampania kontrolna pod względem konwersji.

Oto fragment kodu w języku Python, który pokazuje, jak oceniać wyniki na podstawie wartości p < 0,05 i szacunków wzrostu:

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

Zalety w porównaniu z raportowaniem dotyczącym kampanii

Raportowanie bezpośrednie eksperymentu ma kilka zalet w porównaniu z oddzielnym wysyłaniem zapytań do raportów kampanii:

  1. Scentralizowane dane: pobieraj dane dotyczące grupy kontrolnej i eksperymentalnej w jednym wierszu.
  2. Dane dotyczące ufności statystycznej: podaje obliczone wartości p, szacunki punktowe i marginesy błędu.
  3. Wydajność: eliminuje konieczność ręcznego łączenia lub porównywania wyników z wielu raportów.
  4. Obsługa w ramach kampanii: to jedyny sposób na porównanie grupy kontrolnej z grupą eksperymentalną w przypadku eksperymentów w ramach kampanii, w których ruch jest dzielony w obrębie jednej kampanii.

Raportowanie dotyczące kampanii

W przypadku eksperymentów, które tworzą oddzielne kampanie eksperymentalne (np. SEARCH_CUSTOM), możesz wysyłać zapytania do zasobu campaign i używać campaign.experiment_type, aby identyfikować kampanie BASE (kontrolne) i EXPERIMENT (eksperymentalne). To podejście jest przydatne, jeśli musisz podzielić dane na segmenty na bardziej szczegółowym poziomie (np. według grupy reklam lub słowa kluczowego) albo wyświetlić metadane kampanii niedostępne w zasobie experiment. Wymaga to jednak ręcznego porównywania wyników i przeprowadzania obliczeń statystycznych.

Nie możesz używać raportowania na poziomie kampanii do porównywania grup w eksperymentach w ramach kampanii, ponieważ podział ruchu odbywa się wewnętrznie w obrębie jednej kampanii. Wysyłanie zapytań do campaign w przypadku eksperymentu w ramach kampanii zwraca tylko zagregowane sumy.

Sprawdzone metody

  • Wybierz odpowiedni poziom ufności: ustawienie niższego progu wartości p (< 0,05) może szybciej dostarczyć wskazówek kierunkowych, zwłaszcza przy niższych budżetach lub liczbie konwersji. Poziom ufności 95% (wartość p ≤ 0,05) jest uważany za standard akademicki i może być lepszy w przypadku uzyskiwania dokładniejszych wyników w dłuższym okresie.
  • Prowadź eksperymenty wystarczająco długo: prowadź eksperymenty przez co najmniej 4 tygodnie, aby uwzględnić tygodniowe cykle skuteczności, opóźnienia konwersji i okresy uczenia się.
  • Poczekaj, aż kampania się rozkręci: w przypadku kampanii korzystających z automatycznego określania stawek lub testujących nowe funkcje zignoruj dane z pierwszych 1–2 tygodni, aby modele określania stawek i poziomy ruchu mogły się dostosować do podziału.
  • Stosuj podział 50/50: podział ruchu 50/50 jest zwykle najszybszym sposobem uzyskania istotnych statystycznie wyników.
  • Zaplanuj z wyprzedzeniem: ustaw datę rozpoczęcia eksperymentu na 3–7 dni w przyszłości, aby dać czas na sprawdzenie i zatwierdzenie reklam.
  • W danej chwili możesz prowadzić w kampanii tylko 1 eksperyment.