Use of "X-Stape-User-Id" value in webhook JSON body

Let’s say that we want to only use server Google Tag Manager (no web GTM), using webhooks to send info about all the events. In our webhook JSON body, we have this value of “user_id” where we want to send the User ID via webhook to sGTM. “X-Stape-User-Id” Power-Up seems like a great value we can use for this, provided by Stape.

I was doing some tests and I’ve realized that the “X-Stape-User-Id” value comes as a Request header value, but that comes after sending the request to the webhook endpoint. Is there a way we can use this value beforehand? Or should we send an empty request first, in order to retrieve this value, and then use it for subsequent events?

a) you can’t retrieve it in advance, it gets assigned when we received requests to our servers

b) I am not certain your situation is a good use case for the user id power-up, we discussed this in a seperate topic already. In your case user id would be assigned based on IP etc. of whichever server sending the webhooks and I don’t imagine it has a unique IP (and other components) at all times

1 Like