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”.

field

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.

embed

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=”https://www.formstack.com/forms/js.php?1077929-GwhnMf5cQl-v2″></script><noscript><a href=”https://www.formstack.com/forms/?1077929-GwhnMf5cQl” title=”Online Form”>Online Form – one</a></noscript>

And here is what it looks like after the changes:

<script type=”text/javascript” src=”http://www.formstack.com/forms/js.php?form=1077929&viewkey=GwhnMf5cQl&style_version=2&Referrer=WEBPAGE_1“></script><noscript><a href=”http://www.formstack.com/forms/?1077929-GwhnMf5cQl” 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: “insurance.com” “carquote.com” 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.

Submit

Enjoy!