الحصول على رؤى الصفحات

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

On March 14, 2024, a number of the Page Insights metrics were deprecated for all API versions. The API returns an invalid metric error when calling any of these metrics. Read our blog to learn more.

التقييدات

  • يتم تخزين بيانات أدوات القياس للصفحات العامة بواسطة Facebook لمدة عامين.
  • يتم تخزين بيانات أدوات القياس للصفحات غير المنشورة لمدة 5 أيام فقط.
  • عند عرض أدوات القياس اليومية باستخدام since وuntil، ستكون قيمة end_time الأولى هي التاريخ المحدد حسب since مضافًا إليه 1 بحيث يتضمن بيانات تاريخ since. فعلى سبيل المثال، إذا تم تعيين since إلى 1 يناير 2018، فيتم تعيين end_time إلى 2 يناير 2018 في الساعة 8:00 بتوقيت جرينتش.

قبل البدء

الحصول على أداة قياس واحدة

أرسل طلب GET إلى نقطة النهاية /{page-id}/insights/{metric-name}:

curl -i -X GET "https://graph.facebook.com/{page-id}/insights/page_impressions_unique
  ?access_token={page-access-token}"

عند نجاح العملية، يتلقى تطبيقك الاستجابة التالية:

{
  "data": [
    {
      "name": "page_impressions_unique",
      "period": "day",
      "values": [
        {
          "value": 66226,
          "end_time": "2020-03-10T07:00:00+0000"
        },
        {
          "value": 78037,
          "end_time": "2020-03-11T07:00:00+0000"
        }
      ],
      "title": "Daily Total Reach",
      "description": "Daily: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "{page-id}/insights/page_impressions_unique/day"
    },
    {
      "name": "page_impressions_unique",
      "period": "week",
      "values": [
        {
          "value": 202229,
          "end_time": "2020-03-10T07:00:00+0000"
        },
        {
          "value": 206982,
          "end_time": "2020-03-11T07:00:00+0000"
        }
      ],
      "title": "Weekly Total Reach",
      "description": "Weekly: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "{page-id}/insights/page_impressions_unique/week"
    },
    {
      "name": "page_impressions_unique",
      "period": "days_28",
      "values": [
        {
          "value": 427380,
          "end_time": "2020-03-10T07:00:00+0000"
        },
        {
          "value": 432909,
          "end_time": "2020-03-11T07:00:00+0000"
        }
      ],
      "title": "28 Days Total Reach",
      "description": "28 Days: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "{page-id}/insights/page_impressions_unique/days_28"
    }
  ],
  "paging": {
    "previous": "https://graph.facebook.com/{page-id}/insights?access_token={page-access-token}&pretty=0&metric=page_impressions_unique&since=1583568000&until=1583737200",
    "next": "https://graph.facebook.com/{page-id}/insights?access_token={page-access-token}&pretty=0&metric=page_impressions_unique&since=1583910000&until=1584082800"
  }
}

الحصول على أدوات قياس متعددة

أرسل طلب GET إلى نقطة النهاية /{page-id}/insights مع تضمين الحقل metric:

curl -i -X GET "https://graph.facebook.com/{page-id}/insights
  ?metric=page_impressions_unique,page_impressions_paid
  &access_token={page-access-token}"

عند نجاح العملية، يتلقى تطبيقك الاستجابة التالية:

{
  "data": [
    {
      "name": "page_impressions_unique",
      "period": "day",
      "values": [
        {
          "value": 60,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 50,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "Daily Total Reach",
      "description": "Daily: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "PAGE_ID/insights/page_impressions_unique/day"
    },
    {
      "name": "page_impressions_paid",
      "period": "day",
      "values": [
        {
          "value": 8,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 10,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "Daily Paid Impressions",
      "description": "Daily: The number of times any post or story content from your Page or about your Page entered a person's screen through paid distribution such as an ad. (Total Count)",
      "id": "PAGE_ID/insights/page_impressions_paid/day"
    },
    {
      "name": "page_impressions_unique",
      "period": "week",
      "values": [
        {
          "value": 40,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 50,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "Weekly Total Reach",
      "description": "Weekly: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "PAGE_ID/insights/page_impressions_unique/week"
    },
    {
      "name": "page_impressions_paid",
      "period": "week",
      "values": [
        {
          "value": 50,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 106,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "Weekly Paid Impressions",
      "description": "Weekly: The number of times any post or story content from your Page or about your Page entered a person's screen through paid distribution such as an ad. (Total Count)",
      "id": "PAGE_ID/insights/page_impressions_paid/week"
    },
    {
      "name": "page_impressions_unique",
      "period": "days_28",
      "values": [
        {
          "value": 110,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 10,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "28 Days Total Reach",
      "description": "28 Days: The number of people who had any content from your Page or about your Page enter their screen. This includes posts, check-ins, ads, social information from people who interact with your Page and more. (Unique Users)",
      "id": "PAGE_ID/insights/page_impressions_unique/days_28"
    },
    {
      "name": "page_impressions_paid",
      "period": "days_28",
      "values": [
        {
          "value": 120,
          "end_time": "2024-03-11T07:00:00+0000"
        },
        {
          "value": 20,
          "end_time": "2024-03-12T07:00:00+0000"
        }
      ],
      "title": "28 Days Paid Impressions",
      "description": "28 days: The number of times any post or story content from your Page or about your Page entered a person's screen through paid distribution such as an ad. (Total Count)",
      "id": "PAGE_ID/insights/page_impressions_paid/days_28"
    }
  ],
...

الحصول على أدوات قياس حول منشور صفحة

أرسل طلب GET إلى نقطة النهاية /{page-post-id}/insights مع تضمين الحقول metric:

curl -i -X GET "https://graph.facebook.com{page-post-id}/insights
  ?metric=post_reactions_like_total,post_reactions_love_total,post_reactions_wow_total
  &access_token={page-access-token}"

عند نجاح العملية، يتلقى تطبيقك الاستجابة التالية:

{
  "data": [
    {
      "name": "post_reactions_like_total",
      "period": "lifetime",
      "values": [
        {
          "value": 226
        }
      ],
      "title": "Lifetime Total Like Reactions of a post.",
      "description": "Lifetime: Total like reactions of a post.",
      "id": "{page-post-id}/insights/post_reactions_like_total/lifetime"
    },
    {
      "name": "post_reactions_love_total",
      "period": "lifetime",
      "values": [
        {
          "value": 17
        }
      ],
      "title": "Lifetime Total Love Reactions of a post.",
      "description": "Lifetime: Total love reactions of a post.",
      "id": "{page-post-id}/insights/post_reactions_love_total/lifetime"
    },
    {
      "name": "post_reactions_wow_total",
      "period": "lifetime",
      "values": [
        {
          "value": 1
        }
      ],
      "title": "Lifetime Total wow Reactions of a post.",
      "description": "Lifetime: Total wow Reactions of a post.",
      "id": "{page-post-id}/insights/post_reactions_wow_total/lifetime"
    }
  ],
  "paging": {
    "previous": "https://graph.facebook.com/{page-post-id}/insights?access_token={page-access-token}b&pretty=0&metric=post_reactions_like_total%2Cpost_reactions_love_total%2Cpost_reactions_wow_total&since=1583568000&until=1583737200",
    "next": "https://graph.facebook.com/{page-post-id}/insights?access_token={page-access-token}&pretty=0&metric=post_reactions_like_total%2Cpost_reactions_love_total%2Cpost_reactions_wow_total&since=1583910000&until=1584082800"
  }
}

الحصول على مرات ظهور الفواصل الإعلانية بالفيديو

المتطلبات الإضافية

أرسل طلب GET إلى نقطة النهاية /{page-id} للحصول على مرات الظهور اليومية للفواصل الإعلانية بالفيديو في الصفحة:

curl -i -X GET \
  "https://graph.facebook.com/{page-id}/insights
    ?metric=page_daily_video_ad_break_ad_impressions_by_crosspost_status
    &period=day
    &since=2017-12-10
    &until=2017-12-14"

عند نجاح العملية، يتلقى تطبيقك الاستجابة التالية:

{
  "data": [
    {
      "name": "page_daily_video_ad_breaks_ad_impressions_by_crosspost_status",
      "period": "day",
      "values": [
        {
          "value": {
          "crossposted": 27584,
          "owned": 692730
          },
          "end_time": "2017-12-11T08:00:00+0000"
          },
          {
            "value": {
              "owned": 757456,
              "crossposted": 20593
            },
            "end_time": "2017-12-12T08:00:00+0000"
          },
          {
            "value": {
              "owned": 690092,
              "crossposted": 15372
            },
            "end_time": "2017-12-13T08:00:00+0000"
          }
        ],
        "title": "Daily page level videos ad impression",
        "description": "Number of times an ad was shown during ad breaks in your Page's videos, by distribution type (page_owned and crossposted).",
        "id": "{page-id}/insights/page_daily_video_ad_break_ad_impressions_by_crosspost_status/day"
      }
...

الحصول على مرات الظهور اليومية للفواصل الإعلانية بالفيديو في منشور الصفحة

أرسل طلب GET إلى نقطة النهاية /{page-post-id}/insights مع تضمين الحقل metric:

curl -i -X GET "https://graph.facebook.com/{page-post-id}/insights
  ?metric=post_video_ad_break_ad_impressions
  &period=day
  &since=2017-12-10
  &until=2017-12-14
  &access_token={page-access-token}"

عند نجاح العملية، سيتلقى تطبيقك الاستجابة التالية:

{ 
  "data": [
    {
      "name": "total_video_ad_break_ad_impressions",
      "period": "day",
      "values": [
        {
          "value": 2612,
          "end_time": "2017-12-11T08:00:00+0000"
        },
        {
          "value": 1038,
          "end_time": "2017-12-12T08:00:00+0000"
        },
        {
          "value": 818,
          "end_time": "2017-12-13T08:00:00+0000"
        },
        {
          "value": 553,
          "end_time": "2017-12-14T08:00:00+0000"
        }
      ],
      "title": "Daily Video Ad Break Ad Impressions",
      "description": "Number of times an ad was shown during your video ad breaks.",
      "id": "{video-id}/video_insights/total_video_ad_break_ad_impressions/day"
    }
...

الحصول على مرات الظهور بالكامل للفواصل الإعلانية بالفيديو في منشور الصفحة

curl -i -X GET "https://graph.facebook.com/{page-post-id}/insights
  ?metric=post_video_ad_break_ad_impressions
  &period=lifetime
  &access_token={page-access-token}"

عند نجاح العملية، سيتلقى تطبيقك الاستجابة التالية:

{
  "data": [
    {
      "name": "total_video_ad_break_ad_impressions",
      "period": "lifetime",
      "values": [
        {
          "value": 55468
        }
      ],
      "title": "Lifetime Video Ad Break Ad Impressions",
      "description": "Number of times an ad was shown during your video ad breaks.",
      "id": "{video-id}/video_insights/total_video_ad_break_ad_impressions/lifetime"
    }
...

رموز الأخطاء الشائعة

رمز الخطأرسالة الخطأالوصف

لا شيء

يتم إرجاع مجموعة بيانات فارغة.

تحتاج إلى الإذن read_insights للوصول إلى نقطة النهاية هذه.

100

"(#100) يجب أن تمثل القيمة أداة قياس رؤى صالحة"

قد تكون مشكلة إملائية أو تركيبية.

3001 مع "error_subcode": 1504028

"لم يتم تحديد أداة قياس للحصول عليها. لذا يرجى تحديد أداة قياس واحدة أو أكثر للحصول عليها والمحاولة مرة أخرى."

عند استخدام المعلمة metric، يجب تضمين أداة قياس واحدة على الأقل في الاستعلام.