Track the Referrer When Using a Form on Multiple Websites

Written by Formstack on July 11, 2011

Posted in Form Hacks, Lead Generation

This blog post will show you how to use the same form on different sites with a hidden unique identifier field, so you’ll know the URL of the website that sent each submission to your form.

Let’s say you only want to make one form, but you want to put it all over the Internet and still know which sites the submissions come from. I’m going to show you how you can do this by creating a hidden field for your location information, and then I will show you how to customize your embed code to automatically populate that hidden field.

Our first step is to create a hidden short answer field on your form called “Referrer”.


Now we can start to amend the Javascript embed code to carry the Referrer variable to the form. This variable will be different for each site you want to embed on.

Go to the Publish tab, and then choose Embed Form on the left hand side. Highlight all of the code inside the Javascript embed code box and copy it to a text editor.


So now we have the code in an editor, and we can make the changes we need.

Here is what mine looks like before hand:

<script type=”text/javascript” src=”″></script><noscript><a href=”” title=”Online Form”>Online Form – one</a></noscript>

And here is what it looks like after the changes:

<script type=”text/javascript” src=”“></script><noscript><a href=”” title=”Online Form”>Online Form – one</a></noscript>

The red letters are the changes I made. The first step is to add the form= and the &viewkey= . Then we are going to add the &style_version=2&Referrer=WEBPAGE_1   The WEBPAGE_1 part is what you will change to know where it is coming from. Examples: “” “” and so on.

Now when you look in your submissions it will say where the form came from after it has been submitted.

Hopefully, this will help those of you out there simplify from multiple copies of the same form with information in different submission tables down to just one submission table.