Istnieją 2 główne sposoby raportowania eksperymentów:
- Bezpośrednie raportowanie eksperymentów: wysyłaj zapytania do zasobu
experimentw celu uzyskania danych. Ta opcja udostępnia dane dotyczące grupy kontrolnej i eksperymentalnej w jednej odpowiedzi, a także dane porównania statystycznego, takie jak wzrost i wartości p. Jest to jedyny sposób raportowania eksperymentów w ramach kampanii. - Raportowanie dotyczące kampanii: wysyłaj zapytania do zasobu
campaignw celu uzyskania danych, używająccampaign.experiment_typedo rozróżniania kampanii podstawowych i eksperymentalnych. Ta opcja jest dostępna tylko w przypadku eksperymentów, które korzystają z oddzielnych kampanii kontrolnych i eksperymentalnych, takich jak eksperymenty zarządzane przez system.
Ten przewodnik koncentruje się głównie na bezpośrednim raportowaniu eksperymentów, które jest zgodne ze wszystkimi typami eksperymentów obsługującymi raportowanie.
Bezpośrednie raportowanie eksperymentów
Możesz bezpośrednio wysyłać zapytania 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 udostępnia w tym samym wierszu zarówno dane grupy eksperymentalnej (np. metrics.clicks), jak i grupy kontrolnej (np. metrics.control_clicks).
Zawiera też pola, które pomagają ocenić istotność statystyczną różnicy między grupami:
metrics.*_p_value: prawdopodobieństwo, że zaobserwowane wyniki wystąpią, jeśli eksperyment nie będzie miał rzeczywistego wpływu na dane. Niższa wartość p oznacza większą istotność statystyczną.metrics.*_point_estimate: szacowany procentowy wzrost (dodatni lub ujemny) w przypadku danych w grupie eksperymentalnej w porównaniu z grupą kontrolną. Wraz zmargin_of_erroropisują przedział ufności z określonym poziomem ufności dla szacowanej różnicy. Szacowana wartość 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 napoint_estimate. Jest on obliczany dla określonego poziomu ufności, który zależy od typu eksperymentu.
W zasobie experiment obsługiwane są te pola podstawowych danych, w tym wartość grupy eksperymentalnej, wartość grupy kontrolnej i wymienione wcześniej pola statystyczne:
clicksimpressionscost_microsconversionscost_per_conversionconversion_valueconversion_value_per_cost
W przypadku konwersji pola statystyczne są dostępne w postaci wartości bezwzględnych w tych polach absolute_change, a nie jako wartości względne:
metrics.conversions_absolute_change_p_value: wartość p dla hipotezy zerowej, że eksperyment nie ma wpływu na bezwzględną zmianę konwersji. Zakres od 0 do 1.metrics.conversions_absolute_change_point_estimate: szacunek punktowy podczas szacowania wpływu eksperymentu na bezwzględną zmianę konwersji.metrics.conversions_absolute_change_margin_of_error: margines błędu podczas szacowania wpływu eksperymentu na bezwzględną zmianę konwersji.
Aby uzyskać pomoc w tworzeniu prawidłowych zapytań do zasobu experiment, użyj
Kreatora zapytań Google Ads.
Przykładowe zapytanie
To zapytanie GAQL pobiera kluczowe dane dotyczące 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, szacunku punktowego i marginesu błędu. Jeśli na przykład,
jeśli conversions_absolute_change_p_value jest niższa od wybranego progu (np.0,05 dla 95% ufności), a wartość conversions_absolute_change_point_estimate -
conversions_absolute_change_margin_of_error jest większa od zera, oznacza to,
że grupa eksperymentalna osiąga znacznie lepsze wyniki niż grupa kontrolna
pod względem konwersji.
Oto fragment kodu w języku Python, który pokazuje, jak oceniać wyniki na podstawie wartości p 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
Korzyści w porównaniu z raportowaniem dotyczącym kampanii
Bezpośrednie raportowanie eksperymentów ma kilka zalet w porównaniu z oddzielnym wysyłaniem zapytań do raportów kampanii:
- Scentralizowane dane: pobieraj dane dotyczące grupy kontrolnej i eksperymentalnej w jednym wierszu.
- Dane o ufności statystycznej: udostępnia obliczone wartości p, szacunki punktowe i marginesy błędu.
- Wydajność: eliminuje konieczność ręcznego łączenia lub porównywania wyników z wielu raportów.
- Obsługa w ramach kampanii: jest to jedyny sposób porównania 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 segmentować dane na bardziej szczegółowym poziomie (np. według grupy reklam lub słowa kluczowego) albo wyświetlać metadane kampanii, które nie są dostępne w zasobie experiment. Wymaga jednak ręcznego porównywania skuteczności i obliczeń statystycznych.
Nie możesz używać raportowania na poziomie kampanii do porównywania grup w przypadku eksperymentów 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 może szybciej zapewnić wskazówki kierunkowe, zwłaszcza w przypadku niższych budżetów lub liczby konwersji. Ufność na poziomie 95% (wartość p <= 0,05) jest uważana za standard akademicki i może być lepsza w przypadku 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 nauki.
- Daj czas na rozruch: w przypadku kampanii korzystających z automatycznego określania stawek lub testowania nowych funkcji zignoruj dane z pierwszych 1–2 tygodni, aby dać czas na ponowne dostosowanie modeli określania stawek i poziomów ruchu do podziału.
- Używaj podziału 50/50: podział ruchu 50/50 jest zwykle najszybszym sposobem na uzyskanie 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 danym momencie możesz prowadzić tylko 1 eksperyment w kampanii.