تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختَر النظام الأساسي:
لا يعرض Measurement Protocol في "إحصاءات Google" رموز الخطأ HTTP، حتى إذا كان الحدث منسقًا بشكل غير صحيح أو يفتقر إلى مَعلمات مطلوبة. لضمان أن تكون الأحداث صالحة، يجب التأكد منها باستخدام خادم التحقق من الصلاحية في Measurement Protocol قبل تفعيل مرحلة الإنتاج.
بعد التأكّد من أنّ أحداثك منظَّمة بشكل سليم، عليك التحقّق من صحة عملية التنفيذ للتأكّد من أنّك تستخدم المفاتيح الصحيحة.
يمكنك إما استدعاء خادم التحقّق من الصحة مباشرةً، أو استخدام أداة إنشاء الأحداث
في "إحصاءات Google". يتيح لك "منشئ الأحداث" في "إحصاءات Google" إنشاء الأحداث بشكل تفاعلي، ويستخدم خادم التحقّق من صحة Measurement Protocol للتحقّق من صحتها.
يوضّح هذا الدليل كيفية إرسال الأحداث إلى خادم التحقّق من الصحة في Measurement Protocol لخدمة "إحصاءات Google 4" وكيفية تفسير الردّ.
إرسال الأحداث للتحقّق من صحتها
الفرق الوحيد بين طلب الأحداث المُرسَلة إلى Measurement Protocol وخادم التحقّق من الصلاحية في Measurement Protocol هو عنوان URL.
الخادم
عنوان URL
Measurement Protocol
/mp/collect
خادم التحقّق من الصلاحية في Measurement Protocol
/debug/mp/collect
تتشابه جميع حقول الطلبات الأخرى. راجِع مرجع البروتوكول للحصول على التفاصيل الكاملة حول إنشاء طلب صالح.
يعرض الرمز التالي حدثًا غير صالح يتم إرساله إلى خادم التحقّق من الصحة في Measurement Protocol:
رد التحقّق
في ما يلي استجابة خادم التحقّق من الصلاحية للحدث السابق:
{"validationMessages":[{"fieldPath":"events","description":"Event at index: [0] has invalid name [_badEventName]. Names must start with an alphabetic character.","validationCode":"NAME_INVALID"}]}
في ما يلي استجابة خادم التحقّق لطلب لا يتضمّن أي مشاكل في التحقّق:
تاريخ التعديل الأخير: 2025-08-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Measurement Protocol Validation Server helps ensure your Google Analytics 4 events are correctly formatted before deploying to production.\u003c/p\u003e\n"],["\u003cp\u003eThe Validation Server uses a different URL endpoint (\u003ccode\u003e/debug/mp/collect\u003c/code\u003e) than the standard Measurement Protocol (\u003ccode\u003e/mp/collect\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eValidation responses provide detailed error messages including the field path, description, and a validation code for easier debugging.\u003c/p\u003e\n"],["\u003cp\u003eEvents sent to the Validation Server are not processed and will not appear in your Google Analytics reports.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Analytics Event Builder offers an interactive way to construct and validate events before sending them to the server.\u003c/p\u003e\n"]]],["To ensure valid events, use the Measurement Protocol Validation Server by sending requests to `/debug/mp/collect` instead of `/mp/collect`. Validate events before deploying them. This server doesn't log events in reports. It returns a response with `validationMessages`, an array detailing any errors like `NAME_INVALID`, `VALUE_REQUIRED`, or `VALUE_OUT_OF_BOUNDS`, specifying the `fieldPath`, `description`, and `validationCode` of the issue. Use the Google Analytics Event Builder for interactive event construction.\n"],null,[]]