HTTP Lookup Variable and Transformations

Hello everyone,

I’m working with a GTM Server container where I’m using a transformation to enrich specific events by making an HTTP request to a webhook through the HTTP Lookup variable from Stape. However, it seems that the tag fires before the transformation is fully applied, causing the HTTP request to trigger for every event, which could potentially overload the webhook.

I need the transformation to be applied only when the matching conditions of the transformation apply. Otherwise, it will multiply webhook requests unnecessarily.

Could someone clarify if transformations in GTM Server are applied before or after tag firing? Or is there a way to ensure that the transformation (using the HTTP Lookup variable) completes before the tag triggers?

Thanks for any insights!

transformations are applied to tags before firing, and the whole idea behind http lookup variable is that it return a promise, making it so that its result is available for the tag.

please share more details. note that in preview your http lookup would fire on each event, thats expected behaviour

Hi Dan,

Thank you for the clarification. It’s working as expected now. :tada:

As you said, in preview mode, the HTTP Lookup does trigger for every event. It’s a bit tricky because the GTM preview indicates an outgoing request for each event in this case, even for those not affected by the transformation.

Hi again!

After more than 24 hours in production, it seems that, in fact, it’s still not working as expected. Maybe I wasn’t clear enough in my initial message.

  • I associated my GA4 tag (with the trigger “Client Name = GA4”) to the transformation
  • I added a matching condition to this transformation for specific events that need to be enriched through an HTTP Lookup.

The transformation itself only applies to events that meet the matching condition, but the HTTP Lookup is still being executed for all events, not just the matching ones.

(This is observed in production, not just in preview mode.)

Thanks again for any additional insights! :blush:

This can only mean that your HTTP Lookup variable is also called on other events or the transformation is triggered on other events as well.