Report sugli esperimenti

Esistono due modi principali per generare report sugli esperimenti:

  • Report diretti sugli esperimenti: esegui una query sulla risorsa experiment per le metriche. Questa opzione fornisce le metriche per i gruppi di controllo e sperimentale in un'unica risposta, insieme ai dati di confronto statistico come l'incremento e i valori p. Questo è l'unico modo per generare report sugli esperimenti all'interno della campagna.
  • Report sulle campagne: esegui una query sulla risorsa campaign per le metriche, utilizzando campaign.experiment_type per distinguere tra le campagne di base e quelle sperimentali. Questa opzione è disponibile solo per gli esperimenti che utilizzano campagne di controllo e sperimentali separate, come gli esperimenti gestiti dal sistema.

Questa guida si concentra principalmente sui report diretti sugli esperimenti, che sono compatibili con tutti i tipi di esperimento che supportano i report.

Report diretti sugli esperimenti

Puoi eseguire una query direttamente sulla risorsa experiment per recuperare le metriche sul rendimento e i confronti statistici tra i gruppi di controllo e sperimentale.

Metriche e significatività statistica

Per le metriche principali come clic, impressioni, costo, conversioni e valore di conversione, la risorsa experiment fornisce sia le metriche del gruppo sperimentale (ad esempio, metrics.clicks) sia le metriche del gruppo di controllo (ad esempio, metrics.control_clicks) nella stessa riga.

Fornisce anche campi che ti aiutano a valutare la significatività statistica di qualsiasi differenza tra i gruppi:

  • metrics.*_p_value: la probabilità che i risultati osservati si verifichino se l'esperimento non avesse un effetto reale sulla metrica. Un valore p più basso indica una significatività statistica più elevata.
  • metrics.*_point_estimate: l'incremento percentuale stimato (positivo o negativo) nella metrica specificata per il gruppo sperimentale rispetto al gruppo di controllo. Insieme a margin_of_error, descrivono un intervallo di affidabilità con un livello di confidenza prescritto per la differenza stimata. La quantità stimata è (gruppo sperimentale / gruppo di controllo - 1). La stima puntuale è il centro dell'intervallo di affidabilità.
  • metrics.*_margin_of_error: il raggio dell'intervallo di affidabilità, centrato su point_estimate. Viene calcolato per un livello di confidenza prescritto, che dipende dal tipo di esperimento.

I seguenti campi delle metriche principali sono supportati nella risorsa experiment, inclusi un valore del gruppo sperimentale, un valore del gruppo di controllo e i campi delle statistiche elencati in precedenza:

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

Per le conversioni, in particolare, i campi statistici sono disponibili tramite i seguenti campi absolute_change, anziché come valori relativi:

Per assistenza nella creazione di query valide per la risorsa experiment, utilizza lo strumento Google Ads Query Builder.

Query di esempio

La seguente query GAQL recupera le metriche chiave per un esperimento:

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

Interpreta i risultati

Puoi utilizzare i campi del valore p, della stima puntuale e del margine di errore per determinare se l'esperimento ha prodotto risultati statisticamente significativi. Ad esempio, se conversions_absolute_change_p_value è inferiore alla soglia scelta (ad esempio, 0,05 per una confidenza del 95%) e conversions_absolute_change_point_estimate - conversions_absolute_change_margin_of_error è maggiore di zero, indica che il gruppo sperimentale ha un rendimento significativamente migliore rispetto al gruppo di controllo in termini di conversioni.

Di seguito è riportato uno snippet Python che mostra come valutare i risultati in base al valore p e alle stime dell'incremento:

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

Vantaggi rispetto ai report sulle campagne

I report diretti sugli esperimenti offrono diversi vantaggi rispetto all'esecuzione di query separate sui report sulle campagne:

  1. Metriche centralizzate: recupera le metriche per il gruppo di controllo e quello sperimentale in un' unica riga.
  2. Dati di confidenza statistica: fornisce valori p, stime puntuali e margini di errore calcolati.
  3. Efficienza: non è più necessario unire o confrontare manualmente i risultati di più report.
  4. Supporto all'interno della campagna: è l'unico modo per confrontare il gruppo di controllo e il gruppo sperimentale per gli esperimenti all'interno della campagna, in cui il traffico viene suddiviso all'interno di una singola campagna.

Report sulle campagne

Per gli esperimenti che creano campagne sperimentali separate (ad esempio, SEARCH_CUSTOM), puoi eseguire una query sulla risorsa campaign e utilizzare campaign.experiment_type per identificare le campagne BASE (di controllo) e EXPERIMENT (sperimentali). Questo approccio è utile se devi segmentare le metriche a un livello più granulare (ad esempio, per gruppo di annunci o parola chiave) o visualizzare i metadati della campagna non disponibili nella risorsa experiment. Tuttavia, richiede di eseguire manualmente i confronti sul rendimento e i calcoli statistici.

Non puoi utilizzare i report a livello di campagna per confrontare i gruppi per gli esperimenti all'interno della campagna, poiché la suddivisione del traffico avviene internamente all'interno di una singola campagna. L'esecuzione di query su campaign per un esperimento all'interno della campagna restituisce solo i totali aggregati.

Best practice

  • Seleziona un livello di confidenza appropriato: l'impostazione di una soglia del valore p inferiore può fornire indicazioni direzionali più rapidamente, soprattutto con budget o volumi di conversione inferiori. Una confidenza del 95% (valore p ≤ 0,05) è considerata lo standard accademico e potrebbe essere più adatta per risultati più precisi in un periodo di tempo più lungo.
  • Esegui gli esperimenti per un periodo di tempo sufficiente: esegui gli esperimenti per almeno 4 settimane per tenere conto dei cicli di rendimento settimanali, dei ritardi nella conversione e dei periodi di apprendimento.
  • Dai tempo per l'aumento: per le campagne che utilizzano le offerte automatiche o testano nuove funzionalità, ignora i dati delle prime 1-2 settimane per dare il tempo ai modelli di offerta e ai livelli di traffico di ricalibrarsi in base alla suddivisione.
  • Utilizza suddivisioni 50/50: una suddivisione del traffico 50/50 è in genere il modo più rapido per ottenere risultati statisticamente significativi.
  • Pianifica in anticipo: imposta la data di inizio dell'esperimento 3-7 giorni in futuro per dare il tempo ai processi di revisione e approvazione degli annunci.
  • Puoi eseguire un solo esperimento per campagna alla volta.