WhatsApp Business Account Analytics

The number of messages sent and delivered as well as other metrics are available from the analytics field of a WhatsApp Business Account.

WhatsApp Business Account Analytics

Only sent and delivered metrics for notifications and customer support messages are available using the analytics field. If you wish to access analytics related to cost, you must use the Insights tab of the WhatsApp Manager within Business Manager at this time.

Request

curl -i -X GET \ 
"https://graph.facebook.com/v3.3/your-whatsapp-buiness-account-id?fields=analytics.start(1543543200).end(1544148000).granularity(DAY).phone_numbers([]).country_codes(["US", "BR"])&access_token=your-access-token"

Parameters

Parameters for this field are appended to the field name itself with the values inside parentheses. The structure will look something like this: ?fields=analytics.parameter-one(parameter-one-value).parameter-two(parameter-two-value).

NameRequiredDescription

start

Yes

Type: Integer
The start date for the date range you are retrieving analytics for. This date should be provided as a timestamp at 12AM local time (based on the associated timezone of the WhatsApp Business Account).

end

Yes

Type: Integer
The end date for the date range you are retrieving analytics for. This date should be provided as a timestamp at 12AM local time (based on the associated timezone of the WhatsApp Business Account).

granularity

Yes

Type: String
The granularity by which you would like to retrieve the analytics.
Options: HALF_HOUR, FOUR_HOUR, EIGHT_HOUR, DAY, MONTH

phone_numbers

No

Type: Array
An array of phone numbers for which you would like to retrieve analytics. If not provided, all phone numbers of the WhatsApp Business Account are included.

product_types

No

Type: Array
The types of messages (notification messages and/or customer support messages) for which you want to retrieve notifications. Provide an array and include 0 for notification messages, and 2 for customer support messages. If not provided, analytics will be returned for all messages together.

country_codes

No

Type: Array
The countries for which you would like to retrieve analytics. Provide an array with 2 letter country codes for the countries you would like to include. If not provided, analytics will be returned for all countries you have communicated with.

Response

{
  "analytics": {
    "phone_numbers": [
      "16505550111",
      "16505550112",
      "16505550113"
    ],
    "country_codes": [
      "US",
      "BR"
    ],
    "granularity": "DAY",
    "data_points": [
      {
        "start": 1543543200,
        "end": 1543629600,
        "sent": 196093,
        "delivered": 179715
      },
      {
        "start": 1543629600,
        "end": 1543716000,
        "sent": 147649,
        "delivered": 139032
      },
      {
        "start": 1543716000,
        "end": 1543802400,
        "sent": 61988,
        "delivered": 58830
      },
      {
        "start": 1543802400,
        "end": 1543888800,
        "sent": 132465,
        "delivered": 124392
      },
      {
        "start": 1543888800,
        "end": 1543975200,
        "sent": 181002,
        "delivered": 167335
      },
      {
        "start": 1543975200,
        "end": 1544061600,
        "sent": 168687,
        "delivered": 157838
      },
      {
        "start": 1544061600,
        "end": 1544148000,
        "sent": 161832,
        "delivered": 152383
      }
    ]
  },
  "id": "952305634918047"
}

Reference

For a list of all possible values for each field, refer to the Graph API reference of the WhatsApp Business Account Analytics field.