Hi.
Let’s say I have a form (just a name and email address). I place this form on two websites, website A and website B.
Anyone who submits the form on website A will be identified as being from Company A,
and anyone who submits the form on website B will be identified as being from Company B.
How can I identify companies without having to add a company field to the form?
Your software
My Mautic version is: 6.0.5
My PHP version is: 8.1
My Database type and version is:
dirk_s
March 22, 2026, 3:01pm
2
You potentially could save the referrer - or a static value - into a hidden form field. You add this via javascript on each site individually.
1 Like
Hi
Thank @dirk_s
Thanks for your reply, I’m curious to know the script via Gemini AI
And AI gives me complex javascript.
Then I came up with the idea of adding a hidden text field on the form, and mark that field as Company name, in HTML I entered the value:“my_company_name”
and it worked
Thank you for your reply, which then gave me this idea.
1 Like
dirk_s
March 26, 2026, 8:16pm
4
Hi,
how could that be complex? - It could be as simple as that:
<script>
if (typeof MauticFormCallback === 'undefined') {
var MauticFormCallback = {};
}
MauticFormCallback['myformname'] = {
onValidate: function () {
var field = document.getElementById('mauticform_input_myformname_hiddenfield');
if (field) {
field.value = 'myValue';
}
}
};
</script>
The scripts waits until form is loaded and then sets the field with the individual value.