تقرير عن التجارب

هناك طريقتان رئيسيتان لإعداد التقارير عن التجارب:

  • إعداد التقارير المباشرة عن التجارب: يمكنك طلب بيانات المقياس من مصدر experiment. يوفّر هذا الخيار مقاييس للمجموعة الضابطة ومجموعة التجربة في ردّ واحد، بالإضافة إلى بيانات المقارنة الإحصائية، مثل التحسُّن وقيم الاحتمالية. هذه هي الطريقة الوحيدة لإعداد التقارير عن التجارب داخل الحملة.
  • إعداد تقارير عن الحملات: يمكنك طلب بيانات المقياس من مصدر campaign، باستخدام campaign.experiment_type للتمييز بين الحملات الأساسية والتجريبية. لا يتوفّر هذا الخيار إلا للتجارب التي تستخدِم حملات ضابطة وحملات تجريبية منفصلة، مثل التجارب التي تديرها الأنظمة.

يركّز هذا الدليل بشكل أساسي على إعداد التقارير المباشرة عن التجارب، والتي تتوافق مع جميع أنواع التجارب التي تتيح إعداد التقارير.

إعداد التقارير المباشرة عن التجارب

يمكنك طلب بيانات مصدر experiment مباشرةً لاسترداد مقاييس الأداء والمقارنات الإحصائية بين المجموعة الضابطة ومجموعة التجربة.

المقاييس والدلالة الإحصائية

بالنسبة إلى المقاييس الأساسية، مثل النقرات ومرّات الظهور والتكلفة والإحالات الناجحة وقيمة الإحالة الناجحة، يوفّر مصدر experiment كلاً من مقاييس مجموعة التجربة (على سبيل المثال، metrics.clicks) ومقاييس المجموعة الضابطة (على سبيل المثال، metrics.control_clicks) في الصف نفسه.

يوفّر المصدر أيضًا حقولاً لمساعدتك في تقييم الدلالة الإحصائية لأي اختلاف بين المجموعتين:

  • metrics.*_p_value: هو الاحتمال بأن تحدث النتائج المرصودة إذا لم يكن للتجربة أي تأثير فعلي في المقياس. تشير قيمة الاحتمالية المنخفضة إلى دلالة إحصائية أعلى.
  • metrics.*_point_estimate: هو التحسُّن المقدَّر (إيجابيًا أو سلبيًا) في المقياس المحدّد لمجموعة التجربة مقارنةً بالمجموعة الضابطة، معبّرًا عنه كنسبة مئوية. يصف هذان الحقلان معًا margin_of_error فاصل ثقة بمستوى ثقة محدّد للاختلاف الذي يتم تقديره. الكمية التي يتم تقديرها هي (مجموعة التجربة / المجموعة الضابطة - 1). التقدير النقطي هو مركز فاصل الثقة.
  • metrics.*_margin_of_error: هو نصف قطر فاصل الثقة، والذي يتمركز عند point_estimate. يتم احتسابه لمستوى ثقة محدّد، يعتمد على نوع التجربة.

تتوفّر حقول المقياس الأساسية التالية في مصدر experiment، بما في ذلك قيمة مجموعة التجربة وقيمة المجموعة الضابطة والحقول الإحصائية المدرَجة سابقًا:

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

بالنسبة إلى الإحالات الناجحة تحديدًا، تتوفّر الحقول الإحصائية من خلال حقول absolute_change التالية، بدلاً من القيم النسبية:

للحصول على مساعدة في إنشاء طلبات بحث صالحة لمصدر experiment، استخدِم أداة إنشاء طلبات البحث في "إعلانات Google".

مثال على طلب البحث

يستردّ طلب البحث التالي بلغة طلبات البحث في "إعلانات Google" (GAQL) المقاييس الرئيسية لتجربة معيّنة:

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

تفسير النتائج

يمكنك استخدام حقول قيمة الاحتمالية والتقدير النقطي وهامش الخطأ لتحديد ما إذا كانت تجربتك قد حقّقت نتائج ذات دلالة إحصائية. على سبيل المثال، إذا كانت قيمة conversions_absolute_change_p_value أقل من الحدّ الذي اخترته (على سبيل المثال، 0.05 لمستوى ثقة يبلغ% 95) وكانت قيمة conversions_absolute_change_point_estimate - conversions_absolute_change_margin_of_error أكبر من صفر، يشير ذلك إلى أنّ أداء مجموعة التجربة أفضل بكثير من أداء المجموعة الضابطة من حيث الإحالات الناجحة.

في ما يلي مقتطف من رمز Python يوضّح كيفية تقييم النتائج استنادًا إلى قيمة الاحتمالية وتقديرات التحسُّن:

جافا

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

المزايا مقارنةً بإعداد تقارير عن الحملات

يقدّم إعداد التقارير المباشرة عن التجارب عدّة مزايا مقارنةً بطلب بيانات تقارير الحملات بشكل منفصل:

  1. مقاييس مركزية: يمكنك استرداد مقاييس المجموعة الضابطة ومجموعة التجربة في صف واحد.
  2. بيانات الثقة الإحصائية: يوفّر هذا الخيار قيم الاحتمالية والتقديرات النقطية وهوامش الخطأ المحتسبة.
  3. الكفاءة: لم يعُد من الضروري ربط النتائج أو مقارنتها يدويًا من تقارير متعدّدة.
  4. الدعم داخل الحملة: هذه هي الطريقة الوحيدة لمقارنة المجموعة الضابطة بمجموعة التجربة للتجارب داخل الحملة، حيث يتم تقسيم عدد الزيارات داخل حملة واحدة.

إعداد تقارير عن الحملات

بالنسبة إلى التجارب التي تنشئ حملات تجريبية منفصلة (على سبيل المثال، SEARCH_CUSTOM)، يمكنك طلب بيانات مصدر campaign واستخدام campaign.experiment_type لتحديد BASE (الضابطة) وEXPERIMENT (التجريبية). يكون هذا النهج مفيدًا إذا كنت بحاجة إلى تقسيم المقاييس على مستوى أكثر دقة (على سبيل المثال، حسب المجموعة الإعلانية أو الكلمة الرئيسية) أو عرض بيانات وصفية للحملة غير متاحة في مصدر experiment. ومع ذلك، يتطلّب ذلك إجراء مقارنات الأداء والحسابات الإحصائية يدويًا.

لا يمكنك استخدام إعداد التقارير على مستوى الحملة لمقارنة المجموعتين في التجارب داخل الحملة، لأنّ تقسيم عدد الزيارات يحدث داخليًا ضمن حملة واحدة. لا يؤدي طلب بيانات campaign لتجربة داخل الحملة إلا إلى عرض الإجماليات المجمّعة.

أفضل الممارسات

  • اختيار مستوى ثقة مناسب: يمكن أن يؤدي ضبط حدّ أدنى لقيمة الاحتمالية إلى توفير إرشادات توجيهية بشكل أسرع، لا سيما مع الميزانيات أو أعداد الإحالات الناجحة المنخفضة. يُعدّ مستوى الثقة البالغ% 95 (قيمة الاحتمالية <= 0.05) المعيار الأكاديمي وقد يكون أفضل للحصول على نتائج أكثر دقة على مدى فترة زمنية أطول.
  • إجراء التجارب لفترة طويلة بما يكفي: ننصحك بإجراء التجارب لمدة 4 أسابيع على الأقل لمراعاة دورات الأداء الأسبوعية وتأخّر اكتمال الإحالات الناجحة وفترات التعلّم.
  • منح وقت لتعزيز الأداء: بالنسبة إلى الحملات التي تستخدِم عروض الأسعار المبرمَجة أو تختبر ميزات جديدة، ننصحك بتجاهُل أول أسبوع أو أسبوعَين من البيانات لمنح نماذج عروض الأسعار ومستويات عدد الزيارات وقتًا لإعادة ضبطها على التقسيم.
  • استخدام تقسيمات 50/50: عادةً ما يكون تقسيم عدد الزيارات بنسبة 50/50 هو أسرع طريقة لـ تحقيق نتائج ذات دلالة إحصائية.
  • الجدولة مسبقًا: ننصحك بضبط تاريخ بدء التجربة قبل 3 إلى 7 أيام في المستقبل لمنح وقت لعمليات مراجعة الإعلانات والموافقة عليها.
  • يمكنك إجراء تجربة واحدة فقط لكل حملة في أي وقت.