What page was a contact on when they submitted a form?

If you have forms on multiple pages on your website, you may want to track the page that a contact was on when they submitted your form. There are a couple of ways that this can be accomplished. In this article, you'll learn how to track what page a contact was on when they submitted your form. 

In this article:

Use different forms

You can use a different form for each page on your site. If you give each form a unique name, you can tell what page it comes from. This is the easiest way to track your form back to a specific page. You can use any form type for this solution.

1. Click "Forms" from the left navigation menu. Create a master form for your website.  

2. Click the down carat next to the "Edit" button, then click "Duplicate." 

A copy of your form will appear on the Forms overview page. 

3. Click "Edit" for the form copy you want to rename. 

4. On the next page, you will see the form as it appears to your customer. Notice the light blue box at the top of the page. You can click inside the box to edit the text and change the form's name. 

Repeat these steps for every webpage you want to publish the form to.

As a compliment to renaming your forms, you can add tags to contacts with the "Add a tag" form action. You can use this to tag contacts with the name of the form they submitted or the name of the webpage that the form was published to.

On the profile page for each contact who submitted your form(s), we’ll track which form the contact submitted. You can then use this tag to perform advanced searches, create segments, trigger automations, set goal conditions, adjust contact scores and deal scores, create conditional content, and more.

Use hidden fields and JavaScript

You can create a hidden field that will populate with the variable you set for each webpage. You can use this method if you don't want to keep multiple copies of your form, as in the non-technical method. This will require some knowledge of JavaScript. You may want to use a Certified Consultant for assistance, or use the solution above.  

1. Click "Forms" from the left navigation menu. Create a master form for your website. 

2. Add a hidden field to your form. These can only be used on inline forms

3. Populate your hidden field with JavaScript and set your variable as the value of the hidden field. Your page URL location can be found in window.location.href.

As contacts submit your form(s), the hidden field will be populated with the JavaScript variable you made and displayed on contacts’ profile pages as a custom field. You can use this field to create advanced searches, create segments, trigger automations, adjust contact scores and deal scores, create conditional content, and more.  

Have more questions? Submit a request