Open Tracked/Integrations/Send slack notifications using Google tag manager server container

Send slack notifications using Google tag manager server container

A server container can post to Slack when something important happens, with one small tag and an incoming webhook.

3 min read · Updated October 26, 2026

In this guide
Key takeaways
  • Create a Slack incoming webhook, then a small custom tag that posts a JSON message with sendHttpRequest.
  • Trigger it on events that matter, such as large orders or new leads.
  • Keep personal data out of the message and protect the webhook URL.
PPurchase eventServer container tagSlack channel

Teams like to hear about big orders and new leads without opening a dashboard. A server container already sees those events, so a single tag can post to Slack. This page shows the recipe. Slack's features change, so check Slack's documentation for incoming webhooks. See interesting use cases and server-side tagging as an alternative to Zapier.

1. Create the webhook

  1. In Slack, create an app and enable Incoming Webhooks.
  2. Add the webhook to the channel that should receive messages.
  3. Copy the webhook URL. Treat it like a password: anyone with it can post to the channel.
Ask AI

Ask Ari instead of digging through reports

Ari reads your tracking and ad data and answers in plain words.

2. A tag template

Create a custom tag template in the server container. Add fields for the webhook URL (as a secure variable) and the message text, and allow the request in the template's permissions (Sends HTTP requests, to https://hooks.slack.com/*).

const sendHttpRequest = require("sendHttpRequest");
const JSON = require("JSON");
const getEventData = require("getEventData");

const url = data.webhookUrl;
const text = data.message || ("New event: " + getEventData("event_name"));

sendHttpRequest(url, (statusCode) => {
  if (statusCode >= 200 && statusCode < 300) {
    data.gtmOnSuccess();
  } else {
    data.gtmOnFailure();
  }
}, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  timeout: 3000
}, JSON.stringify({ text: text }));

3. Build the message

Use variables to fill it: order ID, total, currency, source. For example: New order #10293: $640 (source: meta / paid_social). Do not add the customer's name, e-mail or address. Slack messages are stored and shared.

Set up in minutes

Connected in minutes

Add your domain, install the pixel, connect your ad platforms and watch the first events land.

4. Trigger

  • A trigger on the purchase event with a condition that value is greater than a threshold.
  • A trigger on generate_lead for high-value forms.
  • A trigger on error conditions, such as a failed tag, if you have a way to detect them.

5. Test

  1. Open server Preview and send a test purchase above the threshold.
  2. Check that the tag fires and the message arrives.
  3. Send one below the threshold: nothing should arrive.
  4. Check the tag's response in Preview: status 200.

Cautions

SymptomMessages flood the channel
Likely causeThe condition is too loose.
FixRaise the threshold or add a daily summary instead.
SymptomThe webhook URL leaks
Likely causeIt is in a plain variable in the web container.
FixKeep it in a secure server-side field.
SymptomPersonal data appears
Likely causeThe message includes customer details.
FixUse IDs and totals only.
SymptomFailures go unnoticed
Likely causeA failed request is not retried.
FixLog failures and check them. A message is a convenience, not a guarantee.
0 of 5 done
For online stores

Orders from your store, back to the ad that earned them

Your store sends the order once. Open Tracked passes it on to each ad platform, cleaned and deduplicated.

Frequently asked questions

Can a server container send Slack messages?

Yes, with a small custom tag that posts JSON to a Slack incoming webhook.

What goes in the message?

Order ID, total and source. Avoid personal data.

How do I protect the webhook?

Store it in a secure server-side field and allow only Slack's address in the template.

What if the request fails?

It is not retried automatically. Log failures and check them.

Is this reliable enough for critical alerts?

Use it for convenience. For critical alerts, use a monitoring tool with retries.

Do I need spreadsheets to read my results?

No. Once tracking is live, the Open Tracked analytics shows spend, revenue, ROAS and profit, and you can ask Ari, the built-in AI assistant, questions about your own numbers in plain words. Ari's allowance depends on your analytics plan.

Is Open Tracked different from Open Track or Open Space Track?

No. Open Tracked is the official name of our server-side tracking platform, and the website is opentracked.io. Many people search for it as Open Track, OpenTrack or Open Space Track. All of them lead to the same product: server-side Google Tag Manager hosting, first-party analytics and a CRM pipeline.

Fix your tracking at the source

Open Tracked hosts your server-side Tag Manager, keeps first-party cookies alive and shows what each ad is really worth.

Open Tracked
Written by

The Open Tracked team

We build Open Tracked: server-side tracking hosting, analytics and the tools around them, for stores that spend on ads. Questions about this guide, or an idea for the next one?

Write to us Read the docs

Was this article helpful?

Comments

Loading comments...

Turn better tracking into better marketing performance

Start free