تفضيلات الخصوصية

الوظائف الضرورية

مطلوبة للأمان ووظائف الموقع الأساسية.

مفعّلة دائمًا

تشخيصات Landing وإعادة العرض مع إخفاء المحتوى

يقيس الزيارات العامة والمغادرة قبل الإكمال والتفاعلات مع روابط التسجيل باستخدام معرّف مجهول الهوية خاص بعلامة التبويب فقط، دون ربطه بحساب. تُخفى جميع النصوص وتُحظر النماذج.

تحليلات الاستخدام الاختيارية

هل تسمح بتحليلات استخدام PostHog؟ يمكنك تغيير اختيارك في أي وقت من التذييل.

السماح أيضاً بتسجيل الجلسات لإعادة عرضها على هذا الموقع العام

تُظهر إعادة عرض الجلسات في الوضع الاختياري عبر المواقع الصفحات العامة والتفاعلات، مع إخفاء المدخلات والمحتوى الخاص. إعادة عرض الجلسات في التطبيق خيار مستقل.

يتطلب التحليلات الاختيارية؛ إعادة العرض في هذا الوضع عبر المواقع معطّلة افتراضيًا. يعمل وضع Landing أعلاه بشكل منفصل.

لا تفعّل تحليلات المتصفح تحليلات الحساب.

يُحمّل البحث عند استخدامه فقط. تصفّح جميع الفئات أدناه.

الإعلانات

تحليل أداء الإعلانات

تحليل تقرير إعلاني مدفوع محدود يقدمه العميل، مع إسناد صريح وبصمة تجزئة دقيقة للمصدر. لا يتضمن وصولًا إلى المزوِّد أو ادعاءً بعلاقة سببية مع الربحية.

POST /advertising-api/performance/analyze

مراجعة العقد: · sha256:9aedef8d43dd4514

نظرة عامة

تحليل تقرير إعلاني مدفوع محدود يقدمه العميل، مع إسناد صريح وبصمة تجزئة دقيقة للمصدر. لا يتضمن وصولًا إلى المزوِّد أو ادعاءً بعلاقة سببية مع الربحية.

قد يعني نجاح HTTP قبول الطلب لا اكتماله. للعمل الخلفي، احفظ المعرّف المُعاد وتابع العملية نفسها حتى تنتهي. لا يُعدّ المنشور المجدول أوالمقبول منشوراً حتى تأكيد المنصة؛ انتهاء مهلة العميل لا يثبت النتيجة.

المصادقة والأذونات

فئات بيانات الاعتماد المقبولة
user_session, delegated_oauth, personal_access_token
إمكانية مفوّضة
agent:advertising_read
الحد الأدنى لدور مساحة العمل
viewer
نطاق الوصول
الموارد التي يحق لهذا المستخدم الوصول إليها
تلزم موافقة تشمل جميع مساحات العمل
لا
يغيّر الحالة
لا
متى تُعدّ العملية مكتملة
synchronous_http_response

لا يستخدم الرمز إلا حقوق مالكه. يفحص كل طلب عضوية مساحة العمل وملكية المورد والمساحات المحددة والإمكانات الممنوحة. يغيّر core و full الأدوات المعروضة؛ ولا يمنحان وصولاً.

حقول الطلب

تعني «مطلوب» داخل الكائن الأب والفرع المختار. الحقل الابن المطلوب لا يجعل الأب الاختياري مطلوباً. نُسخت القواعد وأسماء الحقول أدناه من العقد.

حقول الطلب
الحقل / الفرعالنوع / مطلوبالقيود
$objectمطلوب في العنصر الأب
  • additionalProperties: false
workspace_idstringمطلوب في العنصر الأب
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
source_kindstringمطلوب في العنصر الأب
  • enum: ["customer_import","official_meta_api"]
source_idstringمطلوب في العنصر الأب
  • minLength: 1
  • maxLength: 100
provider_api_versionstringمطلوب في العنصر الأب
  • const: "v26.0"
provider_account_idstringمطلوب في العنصر الأب
  • pattern: "^[1-9]\\d{1,24}$"
currencystringمطلوب في العنصر الأب
  • pattern: "^[A-Z]{3}$"
timezonestringمطلوب في العنصر الأب
  • minLength: 1
  • maxLength: 100
levelstringمطلوب في العنصر الأب
  • enum: ["campaign","adset","ad"]
start_datestringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
end_datestringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
action_attribution_windowsarrayمطلوب في العنصر الأب
  • minItems: 1
  • maxItems: 1
action_attribution_windows[]stringاختياري / عنصر
  • enum: ["1d_click","7d_click","1d_view"]
action_report_timestringمطلوب في العنصر الأب
  • enum: ["impression","conversion"]
conversion_action_typestringمطلوب في العنصر الأب
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
revenue_action_typestringمطلوب في العنصر الأب
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
completebooleanمطلوب في العنصر الأب—
rowsarrayمطلوب في العنصر الأب
  • maxItems: 500
rows[]objectاختياري / عنصر
  • additionalProperties: false
rows[].account_idstringمطلوب في العنصر الأب
  • pattern: "^[1-9]\\d{1,24}$"
rows[].account_currencystringمطلوب في العنصر الأب
  • pattern: "^[A-Z]{3}$"
rows[].campaign_idstringمطلوب في العنصر الأب
  • pattern: "^[1-9]\\d{1,24}$"
rows[].campaign_namestringاختياري / عنصر
  • maxLength: 200
rows[].adset_idstringاختياري / عنصر
  • pattern: "^[1-9]\\d{1,24}$"
rows[].ad_idstringاختياري / عنصر
  • pattern: "^[1-9]\\d{1,24}$"
rows[].date_startstringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
rows[].date_stopstringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
rows[].spendstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].clicksstringاختياري / عنصر
  • pattern: "^\\d{1,15}$"
rows[].actionsarrayاختياري / عنصر
  • maxItems: 100
rows[].actions[]objectاختياري / عنصر
  • additionalProperties: false
rows[].actions[].action_typestringمطلوب في العنصر الأب
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
rows[].actions[].valuestringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].1d_clickstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].7d_clickstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].actions[].1d_viewstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_valuesarrayاختياري / عنصر
  • maxItems: 100
rows[].action_values[]objectاختياري / عنصر
  • additionalProperties: false
rows[].action_values[].action_typestringمطلوب في العنصر الأب
  • pattern: "^[a-z][a-z0-9_.]{0,99}$"
rows[].action_values[].valuestringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].1d_clickstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].7d_clickstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
rows[].action_values[].1d_viewstringاختياري / عنصر
  • pattern: "^\\d{1,12}(?:\\.\\d{1,6})?$"
مخطط JSON Schema الكامل
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "source_kind": {
      "type": "string",
      "enum": [
        "customer_import",
        "official_meta_api"
      ]
    },
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "provider_api_version": {
      "type": "string",
      "const": "v26.0"
    },
    "provider_account_id": {
      "type": "string",
      "pattern": "^[1-9]\\d{1,24}$"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "level": {
      "type": "string",
      "enum": [
        "campaign",
        "adset",
        "ad"
      ]
    },
    "start_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "end_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "action_attribution_windows": {
      "minItems": 1,
      "maxItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "1d_click",
          "7d_click",
          "1d_view"
        ]
      }
    },
    "action_report_time": {
      "type": "string",
      "enum": [
        "impression",
        "conversion"
      ]
    },
    "conversion_action_type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.]{0,99}$"
    },
    "revenue_action_type": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_.]{0,99}$"
    },
    "complete": {
      "type": "boolean"
    },
    "rows": {
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "account_currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "campaign_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "campaign_name": {
            "type": "string",
            "maxLength": 200
          },
          "adset_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "ad_id": {
            "type": "string",
            "pattern": "^[1-9]\\d{1,24}$"
          },
          "date_start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "date_stop": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "spend": {
            "type": "string",
            "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
          },
          "clicks": {
            "type": "string",
            "pattern": "^\\d{1,15}$"
          },
          "actions": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]{0,99}$"
                },
                "value": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "7d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_view": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                }
              },
              "required": [
                "action_type"
              ],
              "additionalProperties": false
            }
          },
          "action_values": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action_type": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_.]{0,99}$"
                },
                "value": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "7d_click": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                },
                "1d_view": {
                  "type": "string",
                  "pattern": "^\\d{1,12}(?:\\.\\d{1,6})?$"
                }
              },
              "required": [
                "action_type"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "account_id",
          "account_currency",
          "campaign_id",
          "date_start",
          "date_stop"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "workspace_id",
    "source_kind",
    "source_id",
    "provider_api_version",
    "provider_account_id",
    "currency",
    "timezone",
    "level",
    "start_date",
    "end_date",
    "action_attribution_windows",
    "action_report_time",
    "conversion_action_type",
    "revenue_action_type",
    "complete",
    "rows"
  ],
  "additionalProperties": false
}

الاستجابة والاكتمال

رموز نجاح HTTP: 200. عندما تكتمل العملية: synchronous_http_response.

قد يعني نجاح HTTP قبول الطلب لا اكتماله. للعمل الخلفي، احفظ المعرّف المُعاد وتابع العملية نفسها حتى تنتهي. لا يُعدّ المنشور المجدول أوالمقبول منشوراً حتى تأكيد المنصة؛ انتهاء مهلة العميل لا يثبت النتيجة.

تعني «مطلوب» داخل الكائن الأب والفرع المختار. الحقل الابن المطلوب لا يجعل الأب الاختياري مطلوباً. نُسخت القواعد وأسماء الحقول أدناه من العقد.

الاستجابة والاكتمال
الحقل / الفرعالنوع / مطلوبالقيود
$objectمطلوب في العنصر الأب—
contract_versionstringمطلوب في العنصر الأب
  • const: "ad-performance/v1"
source_idstringمطلوب في العنصر الأب
  • maxLength: 100
source_sha256stringمطلوب في العنصر الأب
  • pattern: "^[a-f0-9]{64}$"
identity_verificationstringمطلوب في العنصر الأب
  • enum: ["customer_supplied","accepted_provider_grant"]
currencystringمطلوب في العنصر الأب
  • pattern: "^[A-Z]{3}$"
timezonestringمطلوب في العنصر الأب
  • maxLength: 100
selectionobjectمطلوب في العنصر الأب—
selection.provider_api_versionstringمطلوب في العنصر الأب
  • const: "v26.0"
selection.provider_account_idstringمطلوب في العنصر الأب
  • pattern: "^[1-9]\\d{1,24}$"
selection.currencystringمطلوب في العنصر الأب
  • pattern: "^[A-Z]{3}$"
selection.timezonestringمطلوب في العنصر الأب
  • maxLength: 100
selection.levelstringمطلوب في العنصر الأب
  • enum: ["campaign","adset","ad"]
selection.start_datestringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
selection.end_datestringمطلوب في العنصر الأب
  • pattern: "^\\d{4}-\\d{2}-\\d{2}$"
selection.action_attribution_windowsarrayمطلوب في العنصر الأب
  • minItems: 1
  • maxItems: 1
selection.action_attribution_windows[]stringاختياري / عنصر
  • enum: ["1d_click","7d_click","1d_view"]
selection.action_report_timestringمطلوب في العنصر الأب
  • enum: ["impression","conversion"]
selection.conversion_action_typestringمطلوب في العنصر الأب
  • maxLength: 100
selection.revenue_action_typestringمطلوب في العنصر الأب
  • maxLength: 100
completebooleanمطلوب في العنصر الأب—
rowsarrayمطلوب في العنصر الأب
  • maxItems: 500
rows[]objectاختياري / عنصر—
rows[].row_idstringمطلوب في العنصر الأب
  • maxLength: 100
rows[].metricsobjectمطلوب في العنصر الأب—
rows[].metrics.spendobjectمطلوب في العنصر الأب—
rows[].metrics.spend.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.spend.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.spend.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.spend.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.spend.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.spend.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.spend.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.spend.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.spend.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.spend.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.clicksobjectمطلوب في العنصر الأب—
rows[].metrics.clicks.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.clicks.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.clicks.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.clicks.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.clicks.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.clicks.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.clicks.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.clicks.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.clicks.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.clicks.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.conversionsobjectمطلوب في العنصر الأب—
rows[].metrics.conversions.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.conversions.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.conversions.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.conversions.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.conversions.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.conversions.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.conversions.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.conversions.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.conversions.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.conversions.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.attributed_revenueobjectمطلوب في العنصر الأب—
rows[].metrics.attributed_revenue.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.attributed_revenue.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.attributed_revenue.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.attributed_revenue.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.attributed_revenue.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.attributed_revenue.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.attributed_revenue.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.attributed_revenue.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.attributed_revenue.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.attributed_revenue.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.cpcobjectمطلوب في العنصر الأب—
rows[].metrics.cpc.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.cpc.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.cpc.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.cpc.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.cpc.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.cpc.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.cpc.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.cpc.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.cpc.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.cpc.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.cpaobjectمطلوب في العنصر الأب—
rows[].metrics.cpa.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.cpa.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.cpa.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.cpa.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.cpa.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.cpa.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.cpa.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.cpa.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.cpa.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.cpa.input_refs[]stringاختياري / عنصر
  • maxLength: 300
rows[].metrics.attributed_roasobjectمطلوب في العنصر الأب—
rows[].metrics.attributed_roas.valuestring | nullمطلوب في العنصر الأب—
rows[].metrics.attributed_roas.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
rows[].metrics.attributed_roas.valueanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.attributed_roas.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
rows[].metrics.attributed_roas.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
rows[].metrics.attributed_roas.reasonstring | nullمطلوب في العنصر الأب—
rows[].metrics.attributed_roas.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
rows[].metrics.attributed_roas.reasonanyOf 2nullمطلوب في العنصر الأب—
rows[].metrics.attributed_roas.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
rows[].metrics.attributed_roas.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totalsobjectمطلوب في العنصر الأب—
totals.spendobjectمطلوب في العنصر الأب—
totals.spend.valuestring | nullمطلوب في العنصر الأب—
totals.spend.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.spend.valueanyOf 2nullمطلوب في العنصر الأب—
totals.spend.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.spend.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.spend.reasonstring | nullمطلوب في العنصر الأب—
totals.spend.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.spend.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.spend.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.spend.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.clicksobjectمطلوب في العنصر الأب—
totals.clicks.valuestring | nullمطلوب في العنصر الأب—
totals.clicks.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.clicks.valueanyOf 2nullمطلوب في العنصر الأب—
totals.clicks.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.clicks.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.clicks.reasonstring | nullمطلوب في العنصر الأب—
totals.clicks.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.clicks.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.clicks.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.clicks.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.conversionsobjectمطلوب في العنصر الأب—
totals.conversions.valuestring | nullمطلوب في العنصر الأب—
totals.conversions.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.conversions.valueanyOf 2nullمطلوب في العنصر الأب—
totals.conversions.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.conversions.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.conversions.reasonstring | nullمطلوب في العنصر الأب—
totals.conversions.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.conversions.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.conversions.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.conversions.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.attributed_revenueobjectمطلوب في العنصر الأب—
totals.attributed_revenue.valuestring | nullمطلوب في العنصر الأب—
totals.attributed_revenue.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.attributed_revenue.valueanyOf 2nullمطلوب في العنصر الأب—
totals.attributed_revenue.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.attributed_revenue.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.attributed_revenue.reasonstring | nullمطلوب في العنصر الأب—
totals.attributed_revenue.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.attributed_revenue.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.attributed_revenue.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.attributed_revenue.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.cpcobjectمطلوب في العنصر الأب—
totals.cpc.valuestring | nullمطلوب في العنصر الأب—
totals.cpc.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.cpc.valueanyOf 2nullمطلوب في العنصر الأب—
totals.cpc.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.cpc.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.cpc.reasonstring | nullمطلوب في العنصر الأب—
totals.cpc.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.cpc.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.cpc.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.cpc.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.cpaobjectمطلوب في العنصر الأب—
totals.cpa.valuestring | nullمطلوب في العنصر الأب—
totals.cpa.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.cpa.valueanyOf 2nullمطلوب في العنصر الأب—
totals.cpa.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.cpa.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.cpa.reasonstring | nullمطلوب في العنصر الأب—
totals.cpa.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.cpa.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.cpa.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.cpa.input_refs[]stringاختياري / عنصر
  • maxLength: 300
totals.attributed_roasobjectمطلوب في العنصر الأب—
totals.attributed_roas.valuestring | nullمطلوب في العنصر الأب—
totals.attributed_roas.valueanyOf 1stringمطلوب في العنصر الأب
  • pattern: "^\\d{1,24}(?:\\.\\d{1,6})?$"
totals.attributed_roas.valueanyOf 2nullمطلوب في العنصر الأب—
totals.attributed_roas.unitstringمطلوب في العنصر الأب
  • enum: ["currency","count","currency_per_click","currency_per_conversion","ratio"]
totals.attributed_roas.availabilitystringمطلوب في العنصر الأب
  • enum: ["available","missing_input","zero_denominator","incompatible","partial"]
totals.attributed_roas.reasonstring | nullمطلوب في العنصر الأب—
totals.attributed_roas.reasonanyOf 1stringمطلوب في العنصر الأب
  • maxLength: 300
totals.attributed_roas.reasonanyOf 2nullمطلوب في العنصر الأب—
totals.attributed_roas.input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
totals.attributed_roas.input_refs[]stringاختياري / عنصر
  • maxLength: 300
gapsarrayمطلوب في العنصر الأب
  • maxItems: 1000
gaps[]stringاختياري / عنصر
  • maxLength: 300
suggestionsarrayمطلوب في العنصر الأب
  • maxItems: 3
suggestions[]objectاختياري / عنصر—
suggestions[].rule_idstringمطلوب في العنصر الأب
  • enum: ["supply_revenue","review_comparable_creative_test","complete_coverage"]
suggestions[].rule_versionnumberمطلوب في العنصر الأب
  • const: 1
suggestions[].proposalstringمطلوب في العنصر الأب
  • maxLength: 600
suggestions[].input_refsarrayمطلوب في العنصر الأب
  • maxItems: 2000
suggestions[].input_refs[]stringاختياري / عنصر
  • maxLength: 300
suggestions[].limitationsstringمطلوب في العنصر الأب
  • const: "Observational comparison only; no causal uplift or profitability claim. Human review required."
مخطط JSON Schema الكامل
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "ad-performance/v1"
    },
    "source_id": {
      "type": "string",
      "maxLength": 100
    },
    "source_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "identity_verification": {
      "type": "string",
      "enum": [
        "customer_supplied",
        "accepted_provider_grant"
      ]
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "timezone": {
      "type": "string",
      "maxLength": 100
    },
    "selection": {
      "type": "object",
      "properties": {
        "provider_api_version": {
          "type": "string",
          "const": "v26.0"
        },
        "provider_account_id": {
          "type": "string",
          "pattern": "^[1-9]\\d{1,24}$"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "timezone": {
          "type": "string",
          "maxLength": 100
        },
        "level": {
          "type": "string",
          "enum": [
            "campaign",
            "adset",
            "ad"
          ]
        },
        "start_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "end_date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "action_attribution_windows": {
          "minItems": 1,
          "maxItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "1d_click",
              "7d_click",
              "1d_view"
            ]
          }
        },
        "action_report_time": {
          "type": "string",
          "enum": [
            "impression",
            "conversion"
          ]
        },
        "conversion_action_type": {
          "type": "string",
          "maxLength": 100
        },
        "revenue_action_type": {
          "type": "string",
          "maxLength": 100
        }
      },
      "required": [
        "provider_api_version",
        "provider_account_id",
        "currency",
        "timezone",
        "level",
        "start_date",
        "end_date",
        "action_attribution_windows",
        "action_report_time",
        "conversion_action_type",
        "revenue_action_type"
      ]
    },
    "complete": {
      "type": "boolean"
    },
    "rows": {
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "row_id": {
            "type": "string",
            "maxLength": 100
          },
          "metrics": {
            "type": "object",
            "properties": {
              "spend": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "clicks": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "conversions": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "attributed_revenue": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "cpc": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "cpa": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              },
              "attributed_roas": {
                "type": "object",
                "properties": {
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unit": {
                    "type": "string",
                    "enum": [
                      "currency",
                      "count",
                      "currency_per_click",
                      "currency_per_conversion",
                      "ratio"
                    ]
                  },
                  "availability": {
                    "type": "string",
                    "enum": [
                      "available",
                      "missing_input",
                      "zero_denominator",
                      "incompatible",
                      "partial"
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "input_refs": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    }
                  }
                },
                "required": [
                  "value",
                  "unit",
                  "availability",
                  "reason",
                  "input_refs"
                ]
              }
            },
            "required": [
              "spend",
              "clicks",
              "conversions",
              "attributed_revenue",
              "cpc",
              "cpa",
              "attributed_roas"
            ]
          }
        },
        "required": [
          "row_id",
          "metrics"
        ]
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "spend": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "clicks": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "conversions": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "attributed_revenue": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "cpc": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "cpa": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        },
        "attributed_roas": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{1,24}(?:\\.\\d{1,6})?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "unit": {
              "type": "string",
              "enum": [
                "currency",
                "count",
                "currency_per_click",
                "currency_per_conversion",
                "ratio"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "missing_input",
                "zero_denominator",
                "incompatible",
                "partial"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "input_refs": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 300
              }
            }
          },
          "required": [
            "value",
            "unit",
            "availability",
            "reason",
            "input_refs"
          ]
        }
      },
      "required": [
        "spend",
        "clicks",
        "conversions",
        "attributed_revenue",
        "cpc",
        "cpa",
        "attributed_roas"
      ]
    },
    "gaps": {
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 300
      }
    },
    "suggestions": {
      "maxItems": 3,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "enum": [
              "supply_revenue",
              "review_comparable_creative_test",
              "complete_coverage"
            ]
          },
          "rule_version": {
            "type": "number",
            "const": 1
          },
          "proposal": {
            "type": "string",
            "maxLength": 600
          },
          "input_refs": {
            "maxItems": 2000,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 300
            }
          },
          "limitations": {
            "type": "string",
            "const": "Observational comparison only; no causal uplift or profitability claim. Human review required."
          }
        },
        "required": [
          "rule_id",
          "rule_version",
          "proposal",
          "input_refs",
          "limitations"
        ]
      }
    }
  },
  "required": [
    "contract_version",
    "source_id",
    "source_sha256",
    "identity_verification",
    "currency",
    "timezone",
    "selection",
    "complete",
    "rows",
    "totals",
    "gaps",
    "suggestions"
  ]
}

الأخطاء وإعادة المحاولة بأمان

افحص حالة HTTP والجسم. قد يحوي خطأ التحقق 400 ‏ZodError؛ تستخدم أخطاء المعالج error و message و code. احتفظ بـ request_id أو x-request-id للتشخيص دون اعتماد. أصلح أخطاء وصول 401/403 قبل المحاولة واتّبع Retry-After لـ 429. لكتابة غير مؤكدة أو 5xx، اقرأ الموجود أولاً. أعِد مفتاح منع التكرار حيث يُدعم فقط؛ تختلف المحاولة حسب العملية ولا تضمن التسليم مرة واحدة بالضبط.

دليل استكشاف الأخطاء وإصلاحها

أمثلة

تستخدم الأمثلة قيماً خيالية مفحوصة بالمخططات. استبدل المعرّفات بالمفوّض لك، والوسائط بأصول جاهزة، والتواريخ بوقت نشر مؤكد. افحص أهلية الحساب قبل الكتابة. لا تُرسل الصفحة طلبات API.

اضبط SOSOAPI_ACCESS_TOKEN على خادمك ببيانات اعتماد تقبلها العملية، وأبقِه خارج شيفرة المتصفح. لوكيل الذكاء الاصطناعي، استخدم sosoapi auth login للدخول بالمتصفح ودع CLI يحدّث بيانات اعتماده.

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "source_kind": "customer_import",
  "source_id": "example",
  "provider_api_version": "v26.0",
  "provider_account_id": "12345",
  "currency": "USD",
  "timezone": "UTC",
  "level": "campaign",
  "start_date": "2099-01-15",
  "end_date": "2099-01-15",
  "action_attribution_windows": [
    "1d_click"
  ],
  "action_report_time": "impression",
  "conversion_action_type": "example",
  "revenue_action_type": "example",
  "complete": false,
  "rows": []
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/performance/analyze" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/performance/analyze", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "source_kind": "customer_import",
  "source_id": "example",
  "provider_api_version": "v26.0",
  "provider_account_id": "12345",
  "currency": "USD",
  "timezone": "UTC",
  "level": "campaign",
  "start_date": "2099-01-15",
  "end_date": "2099-01-15",
  "action_attribution_windows": [
    "1d_click"
  ],
  "action_report_time": "impression",
  "conversion_action_type": "example",
  "revenue_action_type": "example",
  "complete": false,
  "rows": []
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /advertising-api/performance/analyze < request.json

مثال استجابة اصطناعية

{
  "contract_version": "ad-performance/v1",
  "source_id": "example",
  "source_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "identity_verification": "customer_supplied",
  "currency": "USD",
  "timezone": "UTC",
  "selection": {
    "provider_api_version": "v26.0",
    "provider_account_id": "12345",
    "currency": "USD",
    "timezone": "UTC",
    "level": "campaign",
    "start_date": "2099-01-15",
    "end_date": "2099-01-15",
    "action_attribution_windows": [
      "1d_click"
    ],
    "action_report_time": "impression",
    "conversion_action_type": "example",
    "revenue_action_type": "example"
  },
  "complete": false,
  "rows": [],
  "totals": {
    "spend": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "clicks": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "conversions": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "attributed_revenue": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "cpc": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "cpa": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    },
    "attributed_roas": {
      "value": null,
      "unit": "currency",
      "availability": "available",
      "reason": null,
      "input_refs": []
    }
  },
  "gaps": [],
  "suggestions": []
}

MCP: sosoapi_ads_performance_analyze