> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/faq/debugging-monitoring/how-do-i-replay-a-webhook-in-the-preview-mode.md).

# How do I replay a Webhook in the preview mode?

It is possible to replay a Webhook, or a Matched Webhook, in the GTM server container's preview mode for debugging purposes

This article explains how to view the payload of received webhooks and how to replay a webhook in the preview mode of your server container.

### Viewing Webhook Logs

In your AdPage dashboard, you can view the payload of every webhook you've received in the Webhook Logs. Below the graph you'll find the list of received webhooks, sorted from most recent to oldest. Each webhook log has two buttons: one to view the webhook payload and one to replay the webhook in the preview mode of your GTM server container.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FN4cA16ziu6Oa5K91HNaR%2Fimage.png?alt=media&amp;token=5e4a53dc-49c0-4668-b1d2-a5a5c06ee9c6" alt=""><figcaption></figcaption></figure>

Clicking the "\</>" button opens the payload of that specific webhook. It contains all the marketing and ecommerce information that was sent from the CMS backend towards the server container.

### Replaying a webhook

To replay a webhook, click the replay button next to the webhook you want. A popup opens where you need to add the preview header.

![](https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FJH72nSqaSuuHyGTlfv8K%2Fimage.png?alt=media\&token=e8c97298-ac23-44d8-9192-0e5550c7e731)

To find the preview header, open your GTM server container in preview mode. Click the three dots in the top-right corner and select Send requests manually.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2F4enPp2DSALnoqDrufIBt%2Fimage.png?alt=media&amp;token=e32b8e45-0987-45e8-b791-562b99dfa0b7" alt=""><figcaption></figcaption></figure>

Copy the x-gtm-server-preview HTTP header and paste it into the input field in the Webhook Replay popup in the Webhook Logs popup.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FZGYvKKGoQzZwnhImsXen%2Fimage.png?alt=media&amp;token=83a1fff5-b86c-4e60-9218-9deed63ff82d" alt=""><figcaption></figcaption></figure>

Click the Replay button and the webhook will be replayed in your sGTM preview mode.

### Replaying a Matched Webhook

To replay a Matched Webhook, click on a Matched Webhook. At the bottom of this popup you're able to find a Replay functionality.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FCDo3kUBZibUYHaRiCMdH%2Fimage.png?alt=media&amp;token=389981a5-ec2d-4ebb-a81b-2f5b1b3c8ca9" alt=""><figcaption></figcaption></figure>

This options opens an input field where you'll have to enter a GTM Server Preview Header. To find the preview header, open your GTM server container in preview mode. Click the three dots in the top-right corner and select Send requests manually.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2F4enPp2DSALnoqDrufIBt%2Fimage.png?alt=media&amp;token=e32b8e45-0987-45e8-b791-562b99dfa0b7" alt=""><figcaption></figcaption></figure>

Copy the x-gtm-server-preview HTTP header and paste it into the input field in the Matched Webhook Replay input field.

<figure><img src="https://2963651437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5eC7lwaeygB0xx6AOZcE%2Fuploads%2FZGYvKKGoQzZwnhImsXen%2Fimage.png?alt=media&amp;token=83a1fff5-b86c-4e60-9218-9deed63ff82d" alt=""><figcaption></figcaption></figure>

Click the Replay button, and the Matched Webhook will be replayed in your sGTM preview mode.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adpage.io/faq/debugging-monitoring/how-do-i-replay-a-webhook-in-the-preview-mode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
