Facebook Graph API - different values for actions between Facebook and API

Asked

Viewed 51 times

0

I’m using the Facebook API (Ads Insights) to return campaign actions. But the value returned by the API does not match any value shown in the Facebook post itself

My Request in Javascript

var d = new FormData();
d.append("access_token", MEU_TOKEN);
d.append("fields", "actions");
d.append("date_preset", "lifetime"); // I want lifetime data

return await (await fetch("https://graph.facebook.com/v3.1/" + campaignid + "/insights", {
    method: "post",
    body: d
})).json();

This request is asynchronous, after the reply I consult the data by the following URL:

https://graph.facebook.com/v3.1/REPORT_RUN_ID/insights?access_token=MEU_TOKEN

This is the JSON returned by the API

{
    "data": [
        {
            "actions": [
                {
                    "action_type": "comment",
                    "value": "2"
                },
                {
                    "action_type": "like",
                    "value": "4"
                },
                {
                    "action_type": "photo_view",
                    "value": "30"
                },
                {
                    "action_type": "post",
                    "value": "1"
                },
                {
                    "action_type": "link_click",
                    "value": "7"
                },
                {
                    "action_type": "page_engagement",
                    "value": "249"
                },
                {
                    "action_type": "post_engagement",
                    "value": "245"
                },
                {
                    "action_type": "post_reaction",
                    "value": "205"
                }
            ],
            "date_start": "2018-07-09",
            "date_stop": "2018-07-15",
            "ad_id": null // removed
        }
    ],
    "paging": {
        "cursors": {
            "before": "MAZDZD",
            "after": "MAZDZD"
        }
    },
    "__fb_trace_id__": null // removed
}

This is the view posted by the account administrator and campaign: inserir a descrição da imagem aqui

What I need to know:

  • Why does Facebook return me the field post_reaction with 205 being that on the Facebook page I have 150 or 160 reactions? This divergence occurs with other fields as well.

Notes

  • I’m not using any SDK
  • My ad group has only ONE ad and only A campaign (this one I’m performing requests)
  • The request and campaign were viewed at the same time, and the campaign is old enough (July 10th) for any cache to be updated; the campaign is also inactive for a few days
  • I know that the Ad Manager brings some API values and that there the values are exactly the same, but in this case the Manager does not bring the Likes, comments or post_reactions, only "Total Actions", a field that will be removed (The Ads manager itself uses version 2.11)
  • I accept responses in different programming languages, Sdks or just URL’s get or post, because my problem is about understanding how this query works (or if I’m doing something wrong) and not about how to implement specifically.
  • I find it very likely that the Facebook interface data will be delayed, as well as on Youtube and others. Wait a while or see a post that long no one looks and compares the results.

  • @Edesonbizerril the post is from July 10, I compared already with other 2~3 previous campaigns and the divergence also happens

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.