# How to pass URL parameters to a form

**URL:** <https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315>\
**Category:** Product Support\
**Created:** [July 21, 2020, 3:11pm UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315 "2020-07-21T15:11:45Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![patrickeidemiller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/patrickeidemiller/32/511_2.png) [@patrickeidemiller](https://forum.mautic.org/u/patrickeidemiller)\
**Post date:** [May 6, 2021, 5:41pm UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/21 "2021-05-06T17:41:01Z")

</div>

I have working see:

> [@Can't pre-fill form fields with procedure described in Mautic documentation](https://forum.mautic.org/t/cant-pre-fill-form-fields-with-procedure-described-in-mautic-documentation/10919):
>
> Your software My Mautic version is: 2.14.2 My PHP version is: Your problem My problem is: I have an email, that embeds a link to a page on my Wordpress website. I have a Mautic form of this page. It’s been integrated there by pasting the code provided in Mautic, otherwise called “Manual integration” in Mautic. What I want to do is to prefill my form fields, by passing key/value pairs as query parameters in my email’s link to the page. It doesn’t work, even though I have been trying the pr…

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 7, 2021, 7:18am UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/22 "2021-05-07T07:18:34Z")

</div>

Hey so I always say this, and it is the beauty of Mautic, that there are really many ways to do something.

In the case of what you want to do Mautic actually has a specific module defined for this which is the preference center.

Steps to create the preference center are as follows:

1. Go to Components - \> Landing Pages
2. Click New and in the setting of the new page choose that this is a presence center:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e5fd2a6c511481726666f8eb6e46cbab270a223a.png)
3. Go ahead and build your page using the page builder
4. When you build the mailer you want to send out you then need to define that the unsubscribe url should use the preference center landing page:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/3fd36f0b5cd2eedf6b254d3f402b0ddb61d97fc0.png)

---

<div class="post-metadata">

**Author:** ![namratasaun](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/namratasaun/32/2801_2.png) [@namratasaun](https://forum.mautic.org/u/namratasaun)\
**Post date:** [May 21, 2021, 9:15am UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/23 "2021-05-21T09:15:57Z")

</div>

thank you for your replies @mikew and @patrickeidemiller , I just wanted to ask that if I don’t want to create a landing page and directly want to use  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/1388e9f3c176abc1cc9f9f046d2e6fcfededf5fd.png)  
unsubscribe feedback form, so pre-fetching won’t be possible there?

---

<div class="post-metadata">

**Author:** ![nimeshvaghasiya](https://avatars.discourse-cdn.com/v4/letter/n/9d8465/32.png) [@nimeshvaghasiya](https://forum.mautic.org/u/nimeshvaghasiya)\
**Post date:** [May 27, 2021, 11:59am UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/24 "2021-05-27T11:59:50Z")

</div>

[mautic-form-preload.js](https://gist.github.com/shawncarr/56c2484cb50bc923107f210310366ad0) this works with query params to landing page.

what about to add form directly to website?  
i.e. if i want to add form to my website using below script:

`<script type="text/javascript" src="https://localhost:8012/mautic/form/generate.js?id=3&tenancy_name=utsavtech"> `

where tenancy\_name is a hidden field and it doesn’t pre-populated.

---

<div class="post-metadata">

**Author:** ![moderns](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@moderns](https://forum.mautic.org/u/moderns)\
**Post date:** [March 28, 2023, 12:09am UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/25 "2023-03-28T00:09:30Z")

</div>

Did it work with you? I’ve just tried but didn’t work. I need to send a value from my website through the form to know if the visitor subscribe from the footer or the popup. Any inputs would be appreciated.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 28, 2023, 4:16am UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/26 "2023-03-28T04:16:16Z")

</div>

Hi,  
This form is just a regular form.  
Are you trying to save the form result of that specific field? (Unsub reason?)

---

<div class="post-metadata">

**Author:** ![moderns](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@moderns](https://forum.mautic.org/u/moderns)\
**Post date:** [March 28, 2023, 1:27pm UTC](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315/27 "2023-03-28T13:27:58Z")

</div>

Hi. Yes. Because I want to use the form in different places. For example, in the footer and in the popup (focused item). So I want to see from where leads come. I added the form to the footer by embedding the JavaScript link for the form. I created hidden input for this form (formsource) and in the JavaScript link I added: &formsource=footer. But, I got nothing in the hidden input (formsource) and didn’t work. Any hints on how to achieve this?

[Previous page](https://forum.mautic.org/t/how-to-pass-url-parameters-to-a-form/15315.md?page=1)
