# Capturing form's page name

**URL:** <https://forum.mautic.org/t/capturing-forms-page-name/1830>\
**Category:** Product Support\
**Created:** [May 14, 2015, 11:16am UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830 "2015-05-14T11:16:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@roman](https://forum.mautic.org/u/roman)\
**Post date:** [May 14, 2015, 11:16am UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/1 "2015-05-14T11:16:52Z")

</div>

Hi team!  
  
  
  
I’m using a mautic form in multiple pages in my website and I need to capture the page name where the form was submited.  
  
  
  
I guess that I need to place a hidden field in the form, but I don’t know what token must I place as value, would you help me?  
  
  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@roman](https://forum.mautic.org/u/roman)\
**Post date:** [May 14, 2015, 11:16am UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/2 "2015-05-14T11:16:52Z")

</div>

Hi team!

I’m using a mautic form in multiple pages in my website and I need to capture the page name where the form was submited.

I guess that I need to place a hidden field in the form, but I don’t know what token must I place as value, would you help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![dbhurley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dbhurley/32/2_2.png) [@dbhurley](https://forum.mautic.org/u/dbhurley)\
**Post date:** [May 15, 2015, 3:13pm UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/3 "2015-05-15T15:13:58Z")

</div>

Probably the best way to do this would be as you suggest with a hidden field. It will depend on what platform your website is built on to determine what the value of that field should be. Are you using a common one? Most CMS have a variable for page title. Then you’ll simply need to have a custom field in Mautic to collect that value.

Hope that helps!  
David

---

<div class="post-metadata">

**Author:** ![roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@roman](https://forum.mautic.org/u/roman)\
**Post date:** [May 15, 2015, 3:54pm UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/4 "2015-05-15T15:54:51Z")

</div>

Yes David, I’m using WP with WPMautic plugin so it should be easy…

But I don’t know what to put in the hidden field to collect the title, I guessed that it would be a token like {page-title} or {embed\_post:post\_title} but it doesn’t work.

Any help would be appreciated!  
R.

---

<div class="post-metadata">

**Author:** ![dbhurley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dbhurley/32/2_2.png) [@dbhurley](https://forum.mautic.org/u/dbhurley)\
**Post date:** [May 15, 2015, 3:58pm UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/5 "2015-05-15T15:58:51Z")

</div>

Awesome! Yeah, so here’s the thing, it will take a bit of code unless you can run php code from within your wordpress post content directly (I think there’s a plugin for that). Otherwise you’ll need to modify the WPMautic plugin to enable an interpretation of the variable. In PHP you can use `<?php echo get_the_title( $ID ); ?> ` to get the title of the page. Then you’d set that to the value for your custom field. It’s a bit tricky but let me know if that makes some kind of sense. 🙂

- David

---

<div class="post-metadata">

**Author:** ![roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@roman](https://forum.mautic.org/u/roman)\
**Post date:** [May 16, 2015, 3:40pm UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/6 "2015-05-16T15:40:17Z")

</div>

Hi @dbhurley! It has sense and I’ve tried it, now I’m able to run PHP code in pages and I can get the tittle of the page throw a token or shortcode like [insert\_php]echo get\_the\_title( $ID );[/insert\_php]

But it can’t be placed as a default value for a field form because the shortcode is not interpreted…

How must manage that to get the value in a form field?

Probably I 'm missing anything from your explanation.

Thanks!

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 11:00pm UTC](https://forum.mautic.org/t/capturing-forms-page-name/1830/7 "2020-02-02T23:00:00Z")

</div>


