> For the complete documentation index, see [llms.txt](https://docs.getpurpledot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getpurpledot.com/integrations/analytics/custom-server-side-tracking.md). Agents can also search and read this documentation through its [MCP server](https://docs.getpurpledot.com/~gitbook/mcp).

# Set up custom server-side tracking

Send Purple Dot checkout events to an HTTPS endpoint or Google Tag Manager server container.

Background: [How analytics integrations work](https://docs.getpurpledot.com/integrations/analytics/how-analytics-integrations-work.md#checkout-events).

{% hint style="warning" %}
Purple Dot sends your receiver a purchase event when the shopper places the pre-order. When you release it, Purple Dot also creates an order in your e-commerce platform, and a connection that reads platform orders can record the sale again. After a test release, check that the new order doesn't duplicate the sale in your receiver. See [De-duplicating orders at release](https://docs.getpurpledot.com/understanding-purple-dot/pre-order-timing-and-your-reporting.md#de-duplicating-orders-at-release).
{% endhint %}

## Before you start

* Your store uses the Purple Dot checkout.
* You have an HTTPS endpoint that accepts JSON `POST` requests and returns a `2xx` response.
* You can edit Merchant Portal integration settings.
* Optional: prepare a bearer token or shared secret for authenticating requests.

## Steps

1. Prepare the receiver. For Google Tag Manager server-side, open your server container and identify the client that receives HTTP requests. Copy that client's HTTPS URL. For a custom receiver, deploy an HTTPS route on your backend.
2. Configure the receiver to parse the [tracking webhook payload](https://docs.getpurpledot.com/integrations/analytics/webhook-tracking.md#event-fields). In Google Tag Manager, configure tags and triggers using the [event mapping](https://docs.getpurpledot.com/integrations/analytics/webhook-tracking.md#events).
3. If you use authentication, configure the receiver to accept the `Authorization: Bearer <token>` header or [verify the signature](https://docs.getpurpledot.com/integrations/analytics/webhook-tracking.md#request-signature).
4. In the Merchant Portal, go to **Settings** > **Integrations**. Under **Analytics**, select **Connect** for **Webhook**.
5. Enter your endpoint in **Webhook URL**. Enter **Bearer Token** and **Shared Secret** if your receiver uses them.
6. Leave **Send unhashed PII data** off to send hashed email addresses and phone numbers. Turn it on only if your receiver requires [unhashed contact details](https://docs.getpurpledot.com/integrations/analytics/webhook-tracking.md#customer-data).
7. Review the linked terms and conditions and select **Accept**.
8. Select **Test Connection**. Confirm your receiver returns `2xx` and the Merchant Portal shows **Credentials verified!**.
9. Select **Save**.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-a8d0cfa1b2f839c5f05ca9fdcc9b6a7958c0d4b1%2Fanalytics-webhook-setup-1.png?alt=media" alt="Webhook setup screen 1"><figcaption><p>Webhook URL and bearer token fields.</p></figcaption></figure>

## Verify

Complete a test pre-order. Confirm your endpoint receives `InitiateCheckout`, `AddPaymentInfo`, and `Purchase` events. For Google Tag Manager server-side, use Preview mode to confirm incoming events and outgoing tags.

The connection test sends a smaller `PurpleDotTestEvent` payload. It verifies the receiver accepts the request; a real checkout verifies production payloads and event mappings.

## Troubleshooting

* [My integration is not syncing](https://docs.getpurpledot.com/troubleshooting/orders-and-inventory/integration-is-not-syncing.md)
* [Get more help](https://docs.getpurpledot.com/troubleshooting/get-more-help.md)

## Related

* **Concept:** [How analytics integrations work](https://docs.getpurpledot.com/integrations/analytics/how-analytics-integrations-work.md#checkout-events)
* **Look up:** [Tracking webhook events and settings](https://docs.getpurpledot.com/integrations/analytics/webhook-tracking.md)
* **Do this:** [Set up custom client-side tracking](https://docs.getpurpledot.com/integrations/analytics/custom-client-side-tracking.md)


---

# 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.getpurpledot.com/integrations/analytics/custom-server-side-tracking.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.
