# Template Analytics

## Why Template Analytics Matter

Template analytics help you understand how your message templates are performing. You can use them to answer questions like:

* How many times was a template **sent**, **delivered**, or **read**?
* If your template includes URL buttons or Quick Reply buttons, how many times were they **clicked**?

For businesses using the Marketing Messages API, you can also track off-site conversion metrics (e.g., app activations, checkouts, purchases) tied to templates.

These insights let you evaluate template effectiveness (open-rate, click-rate), compare templates, optimize your content, calls to action, and more accurately tie WhatsApp template usage to business outcomes.

{% hint style="info" %}
If you want to deeply understand your conversion rates and the ROI/ROAS of your marketing campaigns, consult [360Pilot](https://360dialog.com/360pilot).
{% endhint %}

#### Template Analytics in Countries with Restricted Meta Services <a href="#restricted-countries" id="restricted-countries"></a>

In regions where Meta services are restricted (such as Russia or China), Template Analytics often requires a VPN to function correctly. Without a VPN, end-users experience browser loading errors when clicking URL or Quick Reply buttons.&#x20;

If recipients of your messages are primarily located in such regions, it would be helpful to [disable template analytics](#disable-template-analytics).

### 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 region&#x73;**,** <mark style="color:red;">are not supported</mark>.
* Offsite conversion metrics are available exclusively for businesses onboarded to MM API.

## Enable template analytics <a href="#confirming-template-analytics" id="confirming-template-analytics"></a>

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.

### Via API

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/marketing-messages#post-marketing-template_analytics).

{% hint style="warning" %}
For more error codes, refer to the official documentation from Meta [here](https://developers.facebook.com/docs/whatsapp/business-management-api/error-codes/#template-insights-errors).
{% endhint %}

## Get Template Analytics via API <a href="#template-analytics-parameters" id="template-analytics-parameters"></a>

Data is reported with **daily granularity** in UTC time by default, or in the configured timezone of your WhatsApp Business Account (WABA). The underlying metrics are based only on business-initiated template messages (sent via Cloud API or Marketing Messages API).

Once analytics are enabled, you can retrieve daily metrics for your templates via the API.

[**Endpoint**](https://docs.360dialog.com/docs/messaging-api/api-reference/marketing-messages#get-marketing-template_analytics)

**Request example:**

```json
curl --location 'https://waba-v2.360dialog.io/marketing/template_analytics?start=1759749646&end=1759933601&product_type=MARKETING_MESSAGES_LITE_API&granularity=DAILY&template_ids=1156697826259690&template_ids=1309207764213383&template_ids=1491614292113607&template_ids=666344773154602' \
--header 'D360-API-KEY: '
```

### Template Analytics Parameters

Here’s how to use the parameters:

{% tabs %}
{% tab title="Required" %}

<table><thead><tr><th width="151.72918701171875">Name</th><th width="325.381591796875">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><strong>start</strong></td><td>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. 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.</td><td><mark style="color:$success;">1543536000</mark></td></tr><tr><td><strong>end</strong></td><td>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.</td><td><mark style="color:$success;">1543708800</mark></td></tr><tr><td><strong>granularity</strong></td><td>The granularity by which you would like to retrieve the analytics. Value must be <code>DAILY</code>.</td><td><mark style="color:$success;">DAILY</mark></td></tr><tr><td><strong>template_ids</strong></td><td><p>An array of template IDs for which you would like to retrieve analytics for.</p><p></p><p>Maximum 10.</p></td><td><mark style="color:$success;">[1924084211297547,954638012257287,969725530748535]</mark></td></tr><tr><td><strong>product_type</strong></td><td><p>The product type of the metrics you want to retrieve.</p><p></p><p><code>CLOUD_API</code>: Use this product type to filter for template metrics sent via Cloud API</p><p></p><p><code>MARKETING_MESSAGES_LITE_API</code>: Use this product type to filter for template metrics sent via Marketing Messages Lite API</p></td><td><mark style="color:$success;">MARKETING_MESSAGES_LITE_API</mark></td></tr></tbody></table>
{% endtab %}

{% tab title="Optional" %}

| Name                       | Description                                                                                                                                                                                | Possible Values                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Example Value                                                 |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **metric\_types**          | The types of metrics which you want to retrieve. If omitted or an empty array, analytics for all metric types will be returned.                                                            | <p></p><ul><li><code>COST</code></li><li><code>CLICKED</code></li><li><code>DELIVERED</code></li><li><code>READ</code></li><li><code>SENT</code></li><li><code>APP\_ACTIVATIONS (MM Lite only)</code></li><li><code>APP\_ADD\_TO\_CART (MM Lite only)</code></li><li><code>APP\_CHECKOUTS\_INITIATED (MM Lite only)</code></li><li><code>APP\_PURCHASES (MM Lite only)</code></li><li><code>APP\_PURCHASES\_CONVERSION\_VALUE (MM Lite only)</code></li><li><code>WEBSITE\_ADD\_TO\_CART (MM Lite only)</code></li><li><code>WEBSITE\_CHECKOUTS\_INITIATED (MM Lite only)</code></li><li><code>WEBSITE\_PURCHASES (MM Lite only)</code></li><li><code>WEBSITE\_PURCHASES\_CONVERSION\_VALUE (MM Lite only)</code></li></ul> | <mark style="color:$success;">\[SENT, DELIVERED, READ]</mark> |
| **\<USE\_WABA\_TIMEZONE>** | <p>Whether to show metrics in the WABA’s configured timezone. If false or omitted, metrics will be shown in UTC.</p><p>If true, params start and end must be in the format YYYY-MM-DD.</p> | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | <mark style="color:$success;">true</mark>                     |
| {% endtab %}               |                                                                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                               |
| {% endtabs %}              |                                                                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                               |

<details>

<summary>Response example</summary>

{% code overflow="wrap" %}

```json
{
    "data": [
        {
            "granularity": "DAILY",
            "product_type": "cloud_api",
            "data_points": [
                {
                    "template_id": "666344773154602",
                    "start": 1759708800,
                    "end": 1759795200,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "666344773154602",
                    "start": 1759795200,
                    "end": 1759881600,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "666344773154602",
                    "start": 1759881600,
                    "end": 1759968000,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1156697826259690",
                    "start": 1759708800,
                    "end": 1759795200,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Buy Now",
                            "count": 0
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Buy Now",
                            "count": 0
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1156697826259690",
                    "start": 1759795200,
                    "end": 1759881600,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Buy Now",
                            "count": 0
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Buy Now",
                            "count": 0
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1156697826259690",
                    "start": 1759881600,
                    "end": 1759968000,
                    "sent": 3,
                    "delivered": 3,
                    "read": 3,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Buy Now",
                            "count": 3
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Buy Now",
                            "count": 3
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent",
                            "value": 0.26
                        },
                        {
                            "type": "cost_per_delivered",
                            "value": 0.09
                        },
                        {
                            "type": "cost_per_url_button_click",
                            "value": 0.09
                        }
                    ]
                },
                {
                    "template_id": "1309207764213383",
                    "start": 1759708800,
                    "end": 1759795200,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1309207764213383",
                    "start": 1759795200,
                    "end": 1759881600,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1309207764213383",
                    "start": 1759881600,
                    "end": 1759968000,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1491614292113607",
                    "start": 1759708800,
                    "end": 1759795200,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Track your order",
                            "count": 0
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Track your order",
                            "count": 0
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1491614292113607",
                    "start": 1759795200,
                    "end": 1759881600,
                    "sent": 0,
                    "delivered": 0,
                    "read": 0,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Track your order",
                            "count": 0
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Track your order",
                            "count": 0
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent"
                        },
                        {
                            "type": "cost_per_delivered"
                        },
                        {
                            "type": "cost_per_url_button_click"
                        }
                    ]
                },
                {
                    "template_id": "1491614292113607",
                    "start": 1759881600,
                    "end": 1759968000,
                    "sent": 2,
                    "delivered": 2,
                    "read": 2,
                    "replied": 0,
                    "clicked": [
                        {
                            "type": "url_button",
                            "button_content": "Track your order",
                            "count": 2
                        },
                        {
                            "type": "unique_url_button",
                            "button_content": "Track your order",
                            "count": 2
                        }
                    ],
                    "cost": [
                        {
                            "type": "amount_spent",
                            "value": 0.02
                        },
                        {
                            "type": "cost_per_delivered",
                            "value": 0.01
                        },
                        {
                            "type": "cost_per_url_button_click",
                            "value": 0.01
                        }
                    ]
                }
            ]
        }
    ],
    "paging": {
        "cursors": {
            "before": "MAZDZD",
            "after": "MjQZD"
        }
    }
}
```

{% endcode %}

</details>

{% hint style="info" %}
**Interpretation:**

* **Sent:** Number of times the template was sent on that day in the given date range.
* **Delivered:** Number of times the template sent was successfully delivered
* **Read:** Number of times the template message was read.
* **Clicked:** Array of button‐click metrics (only available for templates in category MARKETING or UTILITY), including total and unique clicks.
* **Cost:** Cost metrics, e.g., total amount spent, cost per delivered, cost per URL button click (for campaigns/tracked templates).
  {% endhint %}

### How to use WABA Timezone

Display data in the WABA’s configured timezone by passing in the `use_waba_timezone` param with a value of `true`.

<details>

<summary>Example</summary>

```json
{
 "data": [
   {
     "waba_timezone": "America/Los_Angeles",
     "granularity": "DAILY",
     "product_type": "cloud_api",
     "data_points": [
         ...
     ]
   }
}
```

</details>

## Disable template analytics <a href="#disable-template-analytics" id="disable-template-analytics"></a>

To disable button click tracking for a specific template, set the `cta_url_link_tracking_opted_out` field to `true`. Here is the explanation [when this might be useful](#restricted-countries).

### Via API using query param

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates-whats_app_message_template_id).

**Request example:**

```
curl --location \
    --request POST 'https://waba-v2.360dialog.io/v1/configs/templates/external_id?cta_url_link_tracking_opted_out=true' \
    --header 'D360-API-KEY: <API_KEY_HERE>'
```

### Via API using the request body&#x20;

Please use this [endpoint](https://docs.360dialog.com/docs/messaging-api/api-reference/templates#post-v1-configs-templates-whats_app_message_template_id).

**Request example:**

```
curl --location \
    --request POST 'https://waba-v2.360dialog.io/v1/configs/templates/external_id' \
    --header 'D360-API-KEY: <API_KEY_HERE>' \
    --data '"cta_url_link_tracking_opted_out": true'
```

## FAQ

<details>

<summary><strong>Can I get hourly granularity?</strong></summary>

No — only daily granularity is available.

</details>

<details>

<summary><strong>What is the maximum number of template IDs I can query at once?</strong></summary>

Up to 10 template IDs per request.

</details>

<details>

<summary><strong>Can I measure ROI/ROAS of my campaigns?</strong></summary>

Yes, but you will need to use 360Pilot to properly attribute costs and revenues per campaign, ad, source, etc.

</details>

<details>

<summary><strong>How can I improve my delivery rate?</strong> </summary>

If you are sending marketing messages, ensure you use [MM API](/partner/messaging/marketing-messages.md) to increase the delivery rate. You can combine it with Conversions API to provide conversion feedback to Meta. This will maximize the performance of your sendouts.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/partner/messaging/template-messages/template-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
