-
I have a URL param on the login page that I want to pass to a login success webhook handler.
How can I do so?
-
There is no official way to do this but you can overload one of the custom fields as outlined here.
Here's sample code to do this, assuming that the parameter you want to track is
registrationCode.<script> const queryString = window.location.search; let urlParams = new URLSearchParams(queryString); const registrationCode = urlParams.get('registrationCode'); if (registrationCode) { console.log('New query string found of '+ registrationCode); let input = document.querySelector('.customParam'); input.setAttribute('value', 'registrationCode = ' + registrationCode); console.log(input.type, input.name, input.value); } </script>Then, in the login form, you want to make sure you have this input field:
<input class="customParam" type="hidden" name="metaData.device.description"/>The value of
metaData.device.descriptionin the webhook event will be the value of theregistrationCodeparameter. -
D dan has marked this topic as solved on
-
M mark.robustelli referenced this topic on
-
A alexandros.nafas referenced this topic on
-
D dan moved this topic from Q&A
-
D dan moved this topic from Frequently Asked Questions (FAQ)