Connect External Data Sources to SGTM via Webhooks

Lukas Becker
by Lukas Becker

The server-side tag manager (SGTM) can receive data directly via webhooks and forward it to downstream systems. As soon as a defined event occurs in a third-party system, that system sends an HTTP request containing the relevant data records to the tagging server. In this way, the SGTM acts as a central data hub that receives and processes server-side data streams, rather than relying exclusively on signals from the browser.

How Data Collection via Webhooks Works in SGTM

The principle is based on direct server-to-server communication. External data sources such as CRMs, e-commerce platforms, ERPs, or payment gateways can trigger automated notifications (webhooks) when certain actions occur. These notifications contain the event data in JSON format and are sent to a specific URL within the SGTM container. The tagging server receives this data, validates it, and forwards it directly to marketing platforms without going through the user’s browser.

Practical Examples of Server-Side Webhook Tracking

Transmit Lead Status Changes from the CRM

The actual value of a lead often doesn’t show up in the CRM until some time later, long after the initial contact request. If the sales team later changes the status in the CRM to “Qualified,” this change immediately triggers a webhook to the SGTM. The tagging server processes the signal and sends it to the marketing platform as an offline conversion. This allows the bidding algorithms to learn which campaigns actually generate valuable revenue, rather than optimizing the budget solely for a high volume of unqualified leads.

Recording E-Commerce Payment Status and Prepaid Purchases

When purchases are tracked directly on the online store’s confirmation page, data errors often occur with certain payment methods. For example, if customers place an order with prepayment or if the purchase process is canceled at a later stage, the tracking system records incomplete orders prematurely. Via webhooks, the store or ERP system sends the signal to SGTM only after the payment has been internally marked as “paid.” This allows unpaid orders, cancellations, or returns to be specifically filtered out, ensuring that only actual sales are transmitted to the marketing platforms.

Track Subscriptions and Recurring Payments

With subscription models (such as SaaS or memberships), only the first transaction is processed directly on the website. All subsequent payments are processed automatically in the background via payment providers such as Stripe or Mollie, without the user having to visit the website again. If the payment provider sends a webhook to SGTM with every successful renewal, recurring revenue and customer lifetime value (CLV) can be tracked continuously and accurately in analytics and marketing platforms.

Technical Implementation Using the heytag Data Client

In order for the tagging server to process incoming webhooks, a suitable interface is required. By default, the server-side Google Tag Manager does not provide a pre-built template for this type of external server signal.

heytag bridges this gap with a specially developed data client for SGTM. This client receives incoming webhook signals, structures the JSON data, and translates it directly into the server container’s internal data model. This allows the transmitted data records to be seamlessly read and used to precisely trigger the desired marketing tags.

Back to overview