Use "referer" in scenarios

Hey team. In this post @Bjorn.drivn told me how to identify the IP address in the header of a webhook. The header contains lots of info but the one i am most interested in is “referer”. Is it possible to build into a scenario a way to identify the referer which would then allow us to customise certain parameters based on where the user is coming from?

Hi @IainM,

A referer header is an optional header that is not always sent by the requestor. Once it is sent, however, and you enabled the option to pass through the headers in your webhook, it will appear in the array. Using the following function combination, you can easily get the value.

{{get(map(<your webhook module ID>.`__IMTHEADERS__`; "value"; "name"; "referer"); 1)}}

You can then use filters to customize your process once you have parsed the value.

I hope this answers your question.
Glenn - Callinetic

1 Like

Glenn - thank you so much for solution. I’m not quite there with it though and keep getting an error. Could I trouble you add a screenshot of how you would use it?

1 Like

Of course! Here you go.

I extended the map function to also return referer with a capital letter R. It really depends on the client how the headers are sent.


Glen - this totally worked. Wow… thank you SO MUCH. Amazing knowledge. Where i was going wrong was that I could see the headers in the webhook logs so I had assumed I had enabled them in the settings. Your phrase “you enabled the option to pass through the headers in your webhook” made me go back and check and sure enough it wasn’t enabled. Switched on and :boom: