# Installing Trackingplan Server-Side Docs

DocsServer-Side

[All docs](/docs)

Get Started

-   [Overview](/docs/overview)
-   [How It Works](/docs/how-it-works)
-   [Your First Plan](/docs/your-first-plan)
-   [Post-Install Warm-Up](/docs/post-install-warm-up)
-   [Multi Account Management](/docs/multi-account-management)

Install

-   [Installing Trackingplan](/docs/installing-trackingplan)
    -   [For Websites](/docs/installing-trackingplan/installing-trackingplan-on-your-websites)
    -   [For Apps](/docs/installing-trackingplan/installing-trackingplan-in-your-apps)
    -   [Server-Side](/docs/installing-trackingplan/server-side)
-   [Environments](/docs/environments)
-   [SDK Update](/docs/sdk-update)
    -   [JS SDK (web)](/docs/sdk-update#js-sdk)
    -   [iOS SDK](/docs/sdk-update#ios-sdk)
    -   [Android SDK](/docs/sdk-update#android-sdk)

The Agent

-   [Threads](/docs/threads)
-   [Reports](/docs/reports)
-   [Audits](/docs/audits)

Use Cases

-   [Investigate a Warning](/docs/debug-warnings)
-   [For Analytics Teams](/docs/analytics-use-cases)
-   [For Performance & Paid Media](/docs/paid-media-use-cases)
-   [For Compliance & Legal](/docs/compliance-use-cases)
-   [For Agencies & Consultancies](/docs/agency-use-cases)

Monitoring

-   [Warnings & Updates](/docs/warning-and-updates)
-   [Data Validation](/docs/data-validation)
-   [Data Layer Monitoring](/docs/data-layer-monitoring)
-   [Consent & Cookie Monitoring](/docs/consent-and-cookie-monitoring)
-   [Privacy Monitoring](/docs/data-privacy-monitoring)
-   [Pixel Monitoring](/docs/pixels-presence-monitoring)
-   [Naming Conventions Monitoring](/docs/naming-conventions-monitoring)
-   [Releases & GTM Monitoring](/docs/autodiscover-releases)

Explore

-   [Explore](/docs/explore)
    -   [Health Summary](/docs/health-summary)
    -   [Data Explorer](/docs/data-explorer)
    -   [Tracks Explorer](/docs/tracks-explorer)
    -   [Presence Map](/docs/presence-map)
    -   [Advanced Views](/docs/advanced-views)
    -   [Session Finder](/docs/session-finder)
-   [Filters & Data Segmentation](/docs/attribution)
-   [Tags](/docs/tags)
-   [Notes & Labels](/docs/notes-labels)
-   [Starred Items](/docs/starred-items)
-   [Sharing](/docs/sharing)

Your Trackingplan

-   [Destinations](/docs/destinations)
    -   [Split Destinations](/docs/split-destinations)
    -   [Events](/docs/events)
    -   [Properties](/docs/properties)
    -   [Attributes](/docs/user-attributes)
    -   [Pages](/docs/pages)
-   [Compliance](/docs/compliance)
    -   [Privacy](/docs/privacy)
    -   [Consent](/docs/consent)
-   [Platform](/docs/platform)
    -   [Daily Checks](/docs/daily-checks)
    -   [Vitals](/docs/platform-metrics)
-   [Acquisition](/docs/acquisition)

Connect

-   [Slack](/docs/slack)
-   [MCP Endpoint](/docs/mcp-endpoint)
-   [Ad Platforms](/docs/ad-platforms)
-   [Trackingplan API](/docs/trackingplan-api)
-   [Trackingplan Exploration API](/docs/trackingplan-exploration-api)
-   [Trackingplan Export API](/docs/trackingplan-export-api)
-   [Data Studio Connector](/docs/trackingplan-connector-for-data-studio)
-   [Chrome Extension](/docs/trackingplans-chrome-extension)
-   [Omnibug Extension](/docs/trackingplan-omnibug-extension)

Account & Security

-   [Settings & Members](/docs/settings)
-   [Privacy & Security](/docs/privacy-and-security)
-   [JSON Export/Import](/docs/export-import-json-schemas)

[Install](/docs) Updated November 26, 2026

# Installing Trackingplan Server-Side

Install Trackingplan for data sent from servers, not browsers, with Segment and Amplitude webhooks, GA4 Measurement Protocol hits and server-side GTM.

> Some of your data never passes through a browser or an app: a CDP forwards your events, your backend sends GA4 Measurement Protocol hits, or your server-side GTM container sends requests on behalf of your site. For these, install Trackingplan on the server side.

> In this section:
> 
> -   [Installing Trackingplan as a Segment Destination](#installing-trackingplan-as-a-segment-destination)
> -   [Installing Trackingplan in Amplitude CDP](#installing-trackingplan-in-amplitude-cdp)
> -   [GA4 Measurement Protocol](#ga4-measurement-protocol)
> -   [Server-side GTM](#server-side-gtm)

Segment, Amplitude and GA4 Measurement Protocol each have their own webhook URL in the **Webhook** tab of your install page: the URL tells Trackingplan how to read the data, so use the Segment URL only in Segment, the Amplitude URL only in Amplitude, and the GA4 Measurement Protocol URL only for copies of those hits.

## Installing Trackingplan as a Segment Destination

> Your install page (`https://app.trackingplan.com/plans/YOUR_TP_ID/install`) generates your Trackingplan Segment webhook URL for you. Open the **Webhook** tab and, under ** Segment**, click ** Copy**. You'll need it in a later step.

![The Webhook tab of the install page](/images/docs-install-page-webhook.webp)

The Webhook tab of the install page

To create and set up a new Webhook (Actions) destination, follow these steps:

1.  Log in to your Segment account and your workspace.
2.  On your *Catalog* page, search for "Webhooks Actions" and click on the **Webhooks (Actions)** destination you’ll see in your search results.
    
    ![](/images/spr-708d6f32-Untitled.png)
    
3.  Click the **Add destination** button.
    
    ![](/images/spr-66e86e7a-Untitled_-12.png)
    
4.  Pick the source you’d like to use with Trackingplan. To add more than one source, repeat this process. Then click **Next**.
    
    ![](/images/spr-67552e35-Untitled.png)
    
5.  Name your destination (e.g. **Trackingplan),** select ** Fill in settings manually** (default), and, to finish this step, click on ** Create Destination**.
    
    ![](/images/spr-44b3aabb-Untitled.png)
    
6.  Next, select the **Mappings** tab for your destination and click on ** New Mapping**.
    
    ![](/images/spr-e8a93889-Untitled.png)
    
7.  Click on **Send** when to define the streaming behavior.
    
    ![](/images/spr-d3b8aa57-image.png)
    
8.  Next, in **Define event trigger** configure a rule to define what events will be sent.
    
    ![](/images/spr-96c24560-image.png)
    
9.  Skip the **Linked Events** step and go straight to ** Map fields**. Configure them using the following settings.
    1.  **URL:** set the ** Webhook URL** from the `/install` page of your plan (see [above](#installing-trackingplan-as-a-segment-destination)).
    2.  **Batch size:** input a batch size of 100.
    3.  **Enable Batching:** set it to ** Yes**
        
        ![](/images/spr-d16bbb30-image.png)
        
10.  Save your settings and enable the destination on the **Settings** tab**.**
     
     ![](/images/spr-ccf446de-Untitled.png)
     
11.  Finally, click on the **Delivery Overview** tab to check if tracks are being sent correctly.
     
     ![](/images/spr-f3ff8ae6-Untitled_-11.png)
     

All set. Questions or problems along the way? [Contact support](mailto:support@trackingplan.com).

## Installing Trackingplan in Amplitude CDP

> Your install page (`https://app.trackingplan.com/plans/YOUR_TP_ID/install`) generates your Trackingplan Amplitude webhook URL for you. Open the **Webhook** tab and, under ** Amplitude**, click ** Copy**. You'll need it in a later step.

With it, you create a new Webhook Destination in your Amplitude Data account, add your Trackingplan Endpoint as the URL and make sure the filter includes all events. Here is the process step by step:

1.  Log in to your Amplitude account and go to the **Data** section of your dashboard:
    
    ![](/images/spr-56af0021-Untitled.png)
    
2.  Click on **Connections** → ** Destinations** → ** Add Destinations**
    
    ![](/images/spr-75de3a38-Untitled.png)
    
3.  Select **Webhook** from the Catalog
    
    ![](/images/spr-c98ce51f-Untitled.png)
    
4.  Set a name to identify the connection (e.g.: **Trackingplan**).
    
    ![](/images/spr-ed625928-Untitled.png)
    
5.  Add your Trackingplan Webhook URL, select **All events** at the events filter, and enable the Destination.
    
    ![](/images/spr-ebf015f1-Untitled.png)
    
6.  Click **Save** and confirm with ** Send Event & Save**.

![](/images/spr-ac9837da-Untitled.png)

That’s it. Once it is set up, your events start reaching Trackingplan. Then [check that Trackingplan is collecting data correctly](/faqs/how-can-i-validate-trackingplan-is-collecting-data-after-its-installation).

Questions or problems along the way? [Contact support](mailto:support@trackingplan.com) and we’ll get back to you as soon as possible.

## GA4 Measurement Protocol

> Trackingplan monitors the **GA4 Measurement Protocol** hits your servers send to Google. You can install it in two ways: through your [server-side GTM container](#server-side-gtm), or by sending a copy of each request to your ** Trackingplan webhook**.

These hits never pass through a browser, so the web snippet and the app SDKs do not see them. Pick the method that matches how your backend sends them.

### Choose your method

| Your backend sends Measurement Protocol hits… | Use |
| --- | --- |
| to your server-side GTM container | [Server-side GTM](#server-side-gtm) |
| straight to `google-analytics.com/mp/collect` | [Webhook](#through-the-webhook) |

### Through the webhook

If your backend sends its hits straight to Google, it also sends a copy of each request to your Trackingplan webhook.

1.  Open your install page, `https://app.trackingplan.com/plans/YOUR_TP_ID/install`, and go to the **Webhook** tab, under ** GA4 Measurement Protocol**.
2.  Enter your GA4 measurement ID (`G-…`) in the field, then click **Copy** to copy your webhook URL. Trackingplan uses the measurement ID to show these hits under the GA4 destination of that property, together with what your website sends to it. If your backend sends hits to more than one GA4 property, get one URL per measurement ID, and send each copy to the URL of the measurement ID it was sent to.
3.  In your backend, find the code that sends each request to `https://www.google-analytics.com/mp/collect`.
4.  After that request, send a copy with the same JSON body to your webhook URL, as it is. Do not add Google's query string to it: your API secret stays out of the copy.
5.  Deploy the change.

Use this URL only for Measurement Protocol copies: the Segment and Amplitude URLs don't work for them, because each webhook URL tells Trackingplan how to read the data it receives.

For example, in Node.js:

```js
const body = JSON.stringify(payload);
const options = { method: 'POST', headers: { 'Content-Type': 'application/json' }, body };

await fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, options);

// the copy for Trackingplan: never let it block or break the request to Google
fetch(TRACKINGPLAN_WEBHOOK_URL, options).catch(() => {});
```

Send the copy after the request to Google, and do not wait for its answer. If the webhook is unreachable, your hits still reach GA4.

### Check that it works

Send a test event from your backend. Then open [Destinations](/docs/destinations): your Measurement Protocol hits appear there with their events and properties. Through the webhook, they appear under the GA4 destination of the measurement ID in your URL.

Questions or problems along the way? [Contact support](mailto:support@trackingplan.com).

## Server-side GTM

> Before you start, we recommend talking to our [support team](mailto:support@trackingplan.com). They'll help you set everything up correctly from the start and avoid problems later.

> To install Trackingplan in server-side GTM, you’ll need to:
> 
> -   [Install Trackingplan’s Tag](#how-to-install-the-trackingplan-tag)
> -   [Add a snippet of code for the third-party templates you want to monitor](#how-to-modify-the-tags-you-want-to-monitor)

![When the Modified tag sends a request, it messages the Trackingplan Tag with a copy of the request, which then forwards it to the Trackingplan Server.](/images/spr-d78b04c0-attachment-84308fd0-9616-437f-aaa7-17c46752f752-CleanShot_2025-03-06_at_13.16.png)

When the Modified tag sends a request, it messages the Trackingplan Tag with a copy of the request, which then forwards it to the Trackingplan Server.

Prefer to watch? This video walks you through an installation from scratch:

### How to Install the Trackingplan Tag

The Trackingplan tag captures GA4 requests and collects the messages from your modified tags, then sends it all to the Trackingplan server for monitoring.

You have two options: add it from the Community Template Gallery, or import it manually with the `.tpl` file. Then create a tag with it, as described below.

**Add the template from the Community Template Gallery**

1.  In your SSGTM container, go to **Templates** → ** Tag Templates** → ** Search Gallery**.
2.  Search for **Trackingplan Server Side Tag** and select it.
3.  Click **Add to workspace**, then confirm with ** Add**.

#### Manual Installation

**Import the template into your SSGTM container**

1.  Download the template from [https://github.com/trackingplan/trackingplan-ssgtm-tag/blob/main/template.tpl](https://github.com/trackingplan/trackingplan-ssgtm-tag/blob/main/template.tpl)
2.  In your SSGTM container, go to Templates → New → Import from file
    
    ![](/images/spr-ac2b0b75-ssgtm_installation.png)
    
    ![](/images/spr-88c8c196-ssgtm_intallation_2.png)
    
3.  Select the downloaded template file
4.  Save
    
    ![](/images/spr-4d57a9b6-ssgtm_installation_3.png)
    

**Create a new tag using the template** (whichever way you added it):

1.  In your SSGTM container, go to Tags → New
    
    ![](/images/spr-373e2a40-CleanShot_2025-03-24_at_14.00.png)
    
2.  Select the Trackingplan template
    
    ![](/images/spr-4019fec5-ssgtm_installation_4_4.png)
    
3.  Add your Trackingplan ID
    
    ![](/images/spr-51d6f154-64ee3820-3c0c-4e11-8716-8f6e763f0101.png)
    
4.  Expand **Settings** → ** Developer Settings**. Set ** Trackingplan Endpoint** to the `tracksEndPoint` from your install page.
5.  Set the trigger to **All Events**
    
    ![](/images/spr-bd22f050-CleanShot_2025-03-24_at_14.03.png)
    
    ![](/images/spr-a0ad77f0-CleanShot_2025-03-24_at_14.03.png)
    
6.  Click Save
7.  Publish your container

> **Using Stape?** Install the tag the same way. On your website there is no domain to configure: Trackingplan detects your Stape container automatically. Add a custom domain with the `stape` parser ID only if your Stape Data Tag requests don't show up in Trackingplan.

### How to modify the tags you want to monitor

Do this on every template you want Trackingplan to monitor.

1.  Open the tag template (this works on any tag)
    
    ![](/images/spr-2789befc-CleanShot_2025-03-06_at_13.18.png)
    
2.  Add the Trackingplan Snippet to the top of the template ([see code below](#trackingplan-snippet))
    
    ![](/images/spr-25d661ac-CleanShot_2025-03-06_at_13.19.png)
    
3.  Remove/Comment the original `sendHttpRequest` and `sendHttpGet` methods.
    
    ![](/images/spr-dc29e214-CleanShot_2025-03-06_at_13.21.png)
    
    ![](/images/spr-43025afc-CleanShot_2025-03-06_at_13.22.png)
    
4.  Enable the Send/Receive message permission
    
    ![](/images/spr-9fd0e464-CleanShot_2025-03-06_at_13.23.png)
    
5.  Save
    
    ![](/images/spr-06dae4d3-CleanShot_2025-03-06_at_13.28.png)
    
6.  Publish your changes

#### Trackingplan Snippet

```javascript
/* Trackingplan snippet to be included in on top of templates to be monitored by Trackingplan */
const sendHttpRequest = (url, arg2, arg3, arg4) => {
    const isCallbackForm = typeof arg2 === 'function';
    const body = isCallbackForm ? arg4 : arg3;
    require('addEventCallback')(() => {
        require('sendMessage')('tp_request', { url: url, body: body });
    });
    return isCallbackForm
        ? require('sendHttpRequest')(url, arg2, arg3, arg4)
        : require('sendHttpRequest')(url, arg2, arg3);
};
const sendHttpGet = function (url, options) {
    require('addEventCallback')(() => {
        require('sendMessage')('tp_request', { url: url });
    });
    return require('sendHttpGet')(url, options);
};
/* End of Trackingplan snippet */
```

#### Using Custom domains

> Many server-side tagging setups use first-party collection domains instead of the platforms' standard endpoints. GA4 hits to your container need no custom domain if they use the usual `/g/collect` path. Configure one only for the requests that don't show up in Trackingplan.

Trackingplan recognizes requests sent to the standard collection domains of the analytics and marketing platforms it supports, automatically. Those domains map to **destination parsers**, which understand each platform's request format and turn the raw requests into the enriched event format you see across Trackingplan.

If your implementation sends data to a custom collection domain instead of the platform's default one, Trackingplan can't identify it automatically. In that case, **configure the custom domain** when you install Trackingplan.

To configure a custom domain, you need:

-   **The custom domain** that your implementation sends requests to (for example, your own collection domain instead of the platform's default endpoint).
-   **The parser ID** that tells Trackingplan which platform those requests belong to (for example, `googleanalytics` for GA4 hits or `tealium` for a Tealium Collect endpoint).

> The parser value is **not** the name you'll see in Trackingplan. It is the internal identifier that tells Trackingplan how to read requests from that domain.

For example, say your server-side GTM container receives GA4 hits at `metrics.example.com/collect` instead of the usual `/g/collect` path. Trackingplan can't tell what that path serves, so you tell it in the `init` options of the Trackingplan snippet on your website (see [Advanced options](/docs/installing-trackingplan/installing-trackingplan-on-your-websites#advanced-options)):

```
customDomains: { "metrics.example.com/collect": "googleanalytics" }
```

From then on, Trackingplan treats every request to `metrics.example.com/collect` as a GA4 hit and parses it with the `googleanalytics` parser.

Some common parser IDs include:

| Platform | Parser ID |
| --- | --- |
| Google Analytics 4 | `googleanalytics` |
| Stape | `stape` |
| Tealium | `tealium` |
| Adobe Analytics | `adobe` |
| Adobe Target | `adobe_target` |
| Jentis | `jentis` |
| Piano | `piano` |

These are only common examples. Not sure which parser ID fits your setup? Contact the [Trackingplan team](mailto:support@trackingplan.com) and we'll help you find it.

### How to debug & verify everything is running properly

To check everything is running properly, look for the following in preview mode:

![](/images/spr-c5e83c87-CleanShot_2025-03-24_at_14.08.png)

1.  Each time one of your modified tags sends a request (1 in the image), a Trackingplan request appears in its payload (2 in the image).
2.  For each Incoming Request (3 in the image), there is a matching Trackingplan request (4 in the image).

[← Previous**Installing Trackingplan in Your Apps**](/docs/installing-trackingplan/installing-trackingplan-in-your-apps) [Next →** Environments**](/docs/environments)

Was this useful? Write to [support@trackingplan.com](mailto:support@trackingplan.com)

On this page

1.  [*01*Installing Trackingplan as a Segment Destination](#installing-trackingplan-as-a-segment-destination)
2.  [*02*Installing Trackingplan in Amplitude CDP](#installing-trackingplan-in-amplitude-cdp)
3.  [*03*GA4 Measurement Protocol](#ga4-measurement-protocol)
4.  [*04*Server-side GTM](#server-side-gtm)
