\{
"data": [\
{\
"waba_timezone": "America/Los_Angeles",\
"granularity": "DAILY",\
"product_type": "cloud_api",\
"data_points": [\
...\
]\
}\
}\
```\
\
### Limitations\
\
Template Analytics are only available for On-Premises API if the account has not opted into Cloud API template analytics.\
Button click analytics are only available for templates categorized as `MARKETING` or `UTILITY`.\
WABAs owned by or shared with Meta Business Accounts in the European Union, United Kingdom, or Japan, or that have a business phone number with a country calling code from any of those countries or regions, are not supported.\
Offsite conversion metrics are available exclusively for businesses onboarded to MM API for WhatsApp.\
Read and click event data for WhatsApp template messages is only available for up to 7 days from the date the message is sent. After this 7-day window, the corresponding read/click counts reset to zero and no further updates are recorded for those messages.\
\
### Confirming template analytics\
\
You must confirm template analytics on your WhatsApp Business Account before you can get template analytics. You can confirm template analytics using the WhatsApp Manager or the API.\
\
By confirming access via the API, you direct Meta to add insights to your WhatsApp Business Account. These insights include link tracking to report website clicks. You can turn off link tracking on each message template. You also direct Meta to collect and anonymize data from your chats with customers. Meta will anonymize this data to improve services it provides you and other businesses.\
\
To confirm via API, send the following request:\
\
```\
POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>?is_enabled_for_insights=true\
```\
\
Once confirmed, we will begin capturing template analytics for the WhatsApp Business Account. Once confirmed, template analytics cannot be disabled.\
\
Upon success, the API will respond with your WhatsApp Business Account ID. For example:\
\
```\
{\
"id": 102290129340398\
}\
```\
\
### Template analytics parameters\
\
| Name | Description | Example Value |\
| --- | --- | --- |\
| `start`<br />_UNIX Timestamp or date string_ | **Required.**<br />The start time for the date range you are retrieving analytics for. Can be represented as either a unix timestamp integer or a date string in the format YYYY-MM-DD.<br />As template analytics are being provided with a daily granularity in the UTC timezone, a start unix timestamp that does not correspond to 0:00 UTC will be adjusted back to the current day’s 00:00 UTC.<br />If `use_waba_timezone` param has a value of true, this value must be a date string in the format YYYY-MM-DD. | `1543536000` |\
| `end`<br />_UNIX Timestamp or date string_ | **Required.**<br />The end time for the date range you are retrieving analytics for. Can be represented as either a unix timestamp integer or a date string in the format YYYY-MM-DD. As template analytics are being provided with a daily granularity in the UTC timezone, an end unix timestamp that does not correspond to 0:00 UTC will be adjusted back to the current day’s 00:00 UTC.<br />If `use_waba_timezone` param has a value of true, this value must be a date string in the format YYYY-MM-DD. | `1543708800` |\
| `granularity`<br />_Enum_ | **Required.**<br />The granularity at which you would like to retrieve the analytics. Value must be `DAILY`. | `DAILY` |\
| `template_ids`<br />_Array of IDs_ | **Required.**<br />An array of template IDs for which you would like to retrieve analytics for.<br />Maximum 10. | `[1924084211297547,954638012257287,969725530748535]` |\
| `metric_types`<br />_Array of enums_ | **Optional.**<br />`COST` node is NOT accessible to businesses who bill through a Solution Partner. To understand your charges, please reach out to your partner.<br />The types of metrics which you want to retrieve. If omitted or an empty array, analytics for all metric types will be returned.<br />Possible values:<br />`COST`<br />`CLICKED`<br />`DELIVERED`<br />`READ`<br />`SENT`<br />`APP_ACTIVATIONS (MM API for WhatsApp only)`<br />`APP_ADD_TO_CART (MM API for WhatsApp only)`<br />`APP_CHECKOUTS_INITIATED (MM API for WhatsApp only)`<br />`APP_PURCHASES (MM API for WhatsApp only)`<br />`APP_PURCHASES_CONVERSION_VALUE (MM API for WhatsApp only)`<br />`WEBSITE_ADD_TO_CART (MM API for WhatsApp only)`<br />`WEBSITE_CHECKOUTS_INITIATED (MM API for WhatsApp only)`<br />`WEBSITE_PURCHASES (MM API for WhatsApp only)`<br />`WEBSITE_PURCHASES_CONVERSION_VALUE (MM API for WhatsApp only)`<br />You can [learn more about cost and click metrics here.](https://developers.facebook.com/documentation/business-messaging/whatsapp/analytics#cost-and-click-metrics). | `[SENT,DELIVERED,READ]` |\
| `product_type`<br />_Enum_ | **Optional.**<br />The product type of the metrics you want to retrieve. If omitted, only analytics for Cloud API will be returned.<br />Possible values:<br />`CLOUD_API`: Use this product type to filter for template metrics sent via Cloud API<br />`MARKETING_MESSAGES_API_FOR_WHATSAPP`: Use this product type to filter for template metrics sent via Marketing Messages API for WhatsApp | `MARKETING_MESSAGES_API_FOR_WHATSAPP` |\
| `<USE_WABA_TIMEZONE>`<br />_Boolean_ | **Optional.**<br />Whether to show metrics in the WABA’s configured timezone. If false or omitted, metrics will be shown in UTC.<br />If true, params start and end must be in the format YYYY-MM-DD. | `true` |\
\
### Examples\
\
#### Getting all template analytics\
\
**Scenario:** Given a 1-day timeframe, get all template analytics metric types for an authentication template and a marketing template with a URL button.\
\
Example Request:\
\
```\
curl -g 'https://graph.facebook.com/v24.0/109259195336416/template_analytics?start=1718064000&end=1718122745&granularity=daily&metric_types=cost%2Cclicked%2Cdelivered%2Cread%2Csent&template_ids=[1421988012088524%2C2632273056924580]' \\
-H 'Authorization: Bearer EAAJB...'\
```\
\
Example response:\
\
```\
{\
"data": [\
{\
"granularity": "DAILY",\
"product_type": "cloud_api", // Only available to businesses in the Marketing Messages API for WhatsApp alpha\
"data_points": [\
{\
"template_id": "1421988012088524",\
"start": 1718064000,\
"end": 1718150400,\
"sent": 1,\
"delivered": 1,\
"read": 1,\
"cost": [\
{\
"type": "amount_spent",\
"value": 0.01\
},\
{\
"type": "cost_per_delivered",\
"value": 0.01\
}\
]\
},\
{\
"template_id": "2632273056924580",\
"start": 1718064000,\
"end": 1718150400,\
"sent": 1,\
"delivered": 1,\
"read": 1,\
"clicked": [\
{\
"type": "quick_reply_button",\
"button_content": "Contact Support",\
"count": 108\
},\
{\
"type": "unique_url_button",\
"button_content": "Tell me more",\
"count": 16\
}\
],\
"cost": [\
{\
"type": "amount_spent",\
"value": 0.03\
},\
{\
"type": "cost_per_delivered",\
"value": 0.03\
},\
{\
"type": "cost_per_url_button_click",\
"value": 0.03\
}\
]\
}\
]\
}\
],\
"paging": {\
"cursors": {\
"before": "MAZDZD",\
"after": "MjQZD"\
}\
}\
}\
```\
\
### Cost and click metrics\
\
**Cost metrics** are returned as an array of cost objects, each with a type and value. Types can be:\
\
`amount_spent` — Total amount spent on conversations opened within the `start` and `end` timeframe as a result of sending the template. See [Opening Conversations](https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing#opening-conversations).\
`cost_per_delivered` — The `amount_spent` value divided by the number of times the template was delivered within the `start` and `end` timeframe.\
`cost_per_url_button_click` — The `amount_spent` value divided by the number of times the template’s URL button was clicked, within the `start` and `end` timeframe. Quick reply button clicks are not included. Object omitted if the template does not have a URL button.\
\
**Click metrics** are returned as an array of JSON objects each with a type and value. Clicks are only returned for URL buttons and quick-reply buttons in templates categorized as `MARKETING` or `UTILITY`.\
\
Types can be:\
\
`url_button` — The total number of clicks on the url button.\
`unique_url_button` — Unique clicks track the number of distinct WhatsApp accounts that have clicked on a button. This metric helps you understand how many individual users are engaging with your CTAs, while eliminating duplicate clicks from the same recipient and providing an accurate measurement of engagement.\
\
### Disabling button click analytics\
\
You can disable button click tracking on an individual template by setting its `cta_url_link_tracking_opted_out` field to `true`. Once disabled, the API will no longer return the clicked property in template analytics or display button engagement/clicks in the WhatsApp Manager when viewing the template’s insights.\
\
#### Request syntax\
\
```\
POST /<TEMPLATE_ID>\
?cta_url_link_tracking_opted_out=<OPT_OUT>\
&category=<TEMPLATE_CATEGORY>\
```\
\
#### Request parameters\
\
| Placeholder | Description | Example Value |\
| --- | --- | --- |\
| `<WHATSAPP_TEMPLATE_ID>`<br />_Template ID_ | **Required.**<br />Template ID. | `245435364965041` |\
| `<OPT_OUT>`<br />_Boolean_ | **Required.**<br />Indicates if template button click tracking is disabled. Set to `true` to disable button click tracking on the template, or `false` to enable.<br />This value is set to `false` upon template creation. | `true` |\
| `<TEMPLATE_CATEGORY>`<br />_String_ | **Required.**<br />Template’s current category.<br />If you set the template category to a value other than its current category, the template status will be set to `PENDING` and the template must undergo template review to be approved. | `marketing` |\
\
#### Example request\
\
```\
curl -X POST 'https://graph.facebook.com/v24.0/245435364965041?cta_url_link_tracking_opted_out=true&category=marketing' \\
-H 'Authorization: Bearer EAAJB...'\
```\
\
#### Example response\
\
Upon success, the API will respond with:\
\
```\
{\
"success": true\
}\
```\
\
## Template group analytics\
\
The `template_group_analytics` field allows you to get the number of times templates within a [template group](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-groups) have been sent, delivered, and read, and the number of times their [URL buttons](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/components#url-buttons) or [Quick Reply buttons](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/components#quick-reply-buttons) have been clicked.\
\
Data is returned with a daily granularity in the default timezone of UTC and WABA’s timezone, with a lookback window of up to 90 days. To show data in the WABA’s configured timezone, pass in the use_waba_timezone param with a value of true.\
\
```\
{\
"data": [\
{\
"waba_timezone": "America/Los_Angeles",\
"granularity": "DAILY",\
"product_type": "cloud_api",\
"data_points": [\
...\
]\
}\
}\
```\
\
### Limitations\
\
Button click analytics are only available for templates categorized as `marketing` or `utility`.\
WABAs owned by or shared with Meta Business Accounts in the European Union, United Kingdom, or Japan, or that have a business phone number with a country calling code from any of those countries or regions, are not supported.\
\
### Enabling template analytics\
\
You must enable template analytics on your WhatsApp Business Account before you can get template group analytics. You can confirm template analytics enablement using the WhatsApp Manager or the API.\
\
By confirming access via the API, you direct Meta to add insights to your WhatsApp Business Account. These insights include link tracking to report website clicks. You can turn off link tracking on each message template. You also direct Meta to collect and anonymize data from your chats with customers. Meta will anonymize this data to improve services it provides you and other businesses.\
\
To confirm enablement via API, send the following request:\
\
`POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>?is_enabled_for_insights=true`\
\
Upon success, the API will respond with your WhatsApp Business Account ID and we will begin capturing template group analytics for the WhatsApp Business Account.\
\
Once enabled, template analytics cannot be disabled.\
\
### Request syntax\
\
```\
GET /<WHATSAPP_BUSINESS_ACCOUNT_ID>/template_group_analytics\
?granularity=daily\
&start=<START_TIME>\
&end=<END_TIME>\
&metric_types=<METRIC_TYPES>\
&template_group_ids=[<TEMPLATE_GROUP_IDS>]\
```\
\
### Request parameters\
\
| Placeholder | Description | Example value |\
| --- | --- | --- |\
| `<WABA_ID>` _String_ | **Required.**<br />WhatsApp Business Account ID. | `102290129340398` |\
| `<START_TIME>`<br />_UNIX Timestamp or date string_ | **Required.**<br />The start time for the date range you are retrieving analytics for. Can be represented as either a unix timestamp integer or a date string in the format YYYY-MM-DD.<br />As template group analytics are being provided with a daily granularity in the UTC timezone, a start unix timestamp that does not correspond to 0:00 UTC will be adjusted back to the current day’s 00:00 UTC.<br />If `use_waba_timezone` param has a value of true, this value must be a date string in the format YYYY-MM-DD. | `1738465116` |\
| `<END_TIME>`<br />_UNIX Timestamp or date string_ | **Required.**<br />The end time for the date range you are retrieving analytics for. Can be represented as either a unix timestamp integer or a date string in the format YYYY-MM-DD.<br />As template group analytics are being provided with a daily granularity in the UTC timezone, an end unix timestamp that does not correspond to 0:00 UTC will be adjusted back to the current day’s 00:00 UTC.<br />If `use_waba_timezone param` has a value of true, this value must be a date string in the format YYYY-MM-DD. | `1739559516` |\
| `<METRIC_TYPES>`<br />_Array of strings_ | **Optional.**<br />Array of metrics you would like to receive. If you send an empty array, the API returns results for all metric types.<br />Values can be:<br />`cost`<br />`clicked`<br />`delivered`<br />`read`<br />`sent`<br />Note that `COST` is not accessible to business customers who are billed through a Solution Partner.<br />See [Cost and click metrics](https://developers.facebook.com/documentation/business-messaging/whatsapp/analytics#cost-and-click-metrics-2) to learn more about cost and click metrics. | ```<br />[<br /> sent,<br /> delivered,<br /> read<br />]<br />``` |\
| `<TEMPLATE_GROUP_IDS>` | **Required.**<br />An array of template group IDs for which you wish to get template group metrics.<br />Maximum 10 IDs. | `102290129340398` |\
| `<USE_WABA_TIMEZONE`>\`<br />_Boolean_ | **Optional.**<br />Whether to show metrics in the WABA’s configured timezone. If false or omitted, metrics will be shown in UTC.<br />If true, params start and end must be in the format YYYY-MM-DD. | `true` |\
\
### Example request\
\
```\
curl -g 'https://graph.facebook.com/v24.0/102290129340398/template_group_analytics?granularity=daily&start=1738465116&end=1739559516&metric_types=sent,delivered,read&template_group_ids=[1044106240855852]' \\
-H 'Authorization: Bearer EAAJB...'\
```\
\
### Example response\
\
Note that the example below has been truncated with an ellipsis (`...`) for brevity.\
\
```\
{\
"data": [\
{\
"granularity": "DAILY",\
"data_points": [\
{\
"template_group_id": "1044106240855852",\
"start": 1739491200,\
"end": 1739577600,\
"sent": 1460,\
"delivered": 1460,\
"read": 1399\
},\
{\
"template_group_id": "1044106240855852",\
"start": 1739404800,\
"end": 1739491200,\
"sent": 673,\
"delivered": 673,\
"read": 645\
},\
...\
]\
}\
],\
"paging": {\
"cursors": {\
"before": "MAZDZD",\
"after": "MjQZD"\
}\
}\
}\
```\
\
### Cost and click metrics\
\
**Cost metrics** are returned as an array of cost objects, each with a type and value. Types can be:\
\
`amount_spent` — Total amount spent on conversations opened within the `start` and `end` timeframe as a result of sending the template. See [Opening Conversations](https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing#opening-conversations).\
`cost_per_delivered` — The `amount_spent` value divided by the number of times the template was delivered within the `start` and `end` timeframe.\
`cost_per_url_button_click` — The `amount_spent` value divided by the number of times the template’s URL button was clicked, within the `start` and `end` timeframe. Quick reply button clicks are not included. Object omitted if the template does not have a URL button.\
\
**Click metrics** are returned as an array of JSON objects each with a type and value. Clicks are only returned for URL buttons and quick-reply buttons in templates categorized as `marketing` or `utility`.\
\
Types can be:\
\
`url_button` — The total number of clicks on the url button.\
`unique_url_button` — Unique clicks track the number of distinct WhatsApp accounts that have clicked on a button. This metric helps you understand how many individual users are engaging with your CTAs, while eliminating duplicate clicks from the same recipient and providing an accurate measurement of engagement.\
\
## Reference\
\
For a list of all possible values for each field, see the Graph API reference of the [WhatsApp Business Account Analytics field](https://developers.facebook.com/docs/graph-api/reference/waba-analytics).\
\
Did you find this page helpful?\
\
\
\
\
\
ON THIS PAGE\
\
Get data\
\
Request syntax\
\
Request parameters\
\
Messaging analytics\
\
Messaging analytics parameters\
\
Example\
\
Conversation analytics\
\
Conversation analytics parameters\
\
Examples\
\
Get monthly data, using all breakdowns\
\
Get data for a specific phone number, using all breakdowns and half hour granularity\
\
Get monthly data, using conversation type breakdowns\
\
Get half-hour data broken down by conversation category\
\
Get half-hour data broken down by conversation category and conversation type\
\
Pricing analytics\
\
Request syntax\
\
Pricing analytics parameters\
\
Volume tier information\
\
Example response syntax with tier information\
\
Example request\
\
Example response\
\
Template analytics\
\
Limitations\
\
Confirming template analytics\
\
Template analytics parameters\
\
Examples\
\
Getting all template analytics\
\
Cost and click metrics\
\
Disabling button click analytics\
\
Request syntax\
\
Request parameters\
\
Example request\
\
Example response\
\
Template group analytics\
\
Limitations\
\
Enabling template analytics\
\
Request syntax\
\
Request parameters\
\
Example request\
\
Example response\
\
Cost and click metrics\
\
Reference\
\
* * *