Server Side Tracking

How to Send CRM or Payment Webhooks into Server GTM

Some of the most important conversions never happen on your website. A lead becomes a paying customer three weeks later in the CRM. A subscription renews in Stripe. A sales rep closes a deal on the phone. Browser tracking will never see these. Webhooks let your server container hear about them, and then pass them on to Meta, Google Ads or GA4.

How it works

  1. Something happens in your CRM or payment tool (deal won, payment succeeded).
  2. That tool sends a webhook: a small JSON message to a URL you choose.
  3. Your server container receives it with a client that listens on that URL path.
  4. Your server tags send the conversion to ad platforms.

Step by step

  1. Pick a path. For example https://ss.yourstore.com/webhook/crm. Use your custom domain.
  2. Add a client that accepts the webhook. Stape’s Data Client can claim requests on a custom path. Set the path and allow POST with JSON.
  3. Create the webhook in your tool. In HubSpot, Pipedrive, Stripe or Zapier, add a webhook pointing to that URL. Choose the event (for example “deal stage = won” or “payment succeeded”).
  4. Send the right fields. At minimum: event name, value, currency, order or deal ID, email and phone. Include the original click IDs (gclid, fbclid) if your CRM stored them.
  5. Map fields in sGTM. Create Event Data variables for each field in the JSON.
  6. Add your tags. Meta CAPI (set action source to the right type, like system_generated or physical_store), Google Ads offline or Enhanced Conversions for leads, GA4 if needed.
  7. Test with a sample payload. Send a test JSON with a tool like Postman or the CRM’s “send test” button. Watch it in server preview.

A simple example payload

{
  "event_name": "deal_won",
  "value": 1200,
  "currency": "USD",
  "deal_id": "D-10482",
  "email": "client@example.com",
  "phone": "+8801700000000",
  "gclid": "Cj0KCQ..."
}

Mistakes to avoid

  • Not storing click IDs at lead time. If the form does not save gclid and fbclid into the CRM, the offline conversion has nothing to connect to. Fix the form first.
  • No security. Add a secret key in a header or query parameter and check it in the client. Otherwise anyone could send fake conversions.
  • Wrong event time. Send the real conversion time, not the time the webhook arrived, when the platform allows it.
  • Duplicates on retries. Webhooks can resend. Use the deal or order ID as the event ID.

Where this pays off

A pattern I see with B2B and service businesses: ads are optimised for form fills, but half the forms are junk. Sending “qualified” and “won” stages back through webhooks lets Meta and Google optimise for real revenue, not just form submits.

Bottom line

If your money is made after the website, your tracking must follow it there. A webhook into sGTM is the simplest bridge.

Source reading: Stape blog

Leave a Reply

Your email address will not be published. Required fields are marked *