Sup.js saves URL parameters and inputs them into any form submitted during a visitors session on you site.
SUP (Save URL Parameters) is a script that lets you save URL parameters and values in a visitor's session, then insert them into any form the visitor submits during their session.
See longer article with background and examples: Get URL + UTM Parameters with Javascript.
Adding parameters (or queries) to a URL can provide additional information about website visitors, such as:
It is often helpful to capture that information any time a visitor submits a form on your website. For example, if a visitor completes a signup or contact form, you might want to know what marketing campaign can be attributed with that conversion. Some marketing platforms and form tools are able to capture URL parameters, but only if they are present on the page—if a visitor views more than one page then the URL parameters will not be saved. Unfortunately this means it works only if the visitor completes the form on the same page they landed on, without navigating away.
Some analytics tools can recognize and report on some or all URL parameters, but they don't show it side-by-side with form data. For example, Google Analytics only parses UTM parameters, and it does not allow you to save personal information from forms. In many cases you may want to see those values for every form completion.
There exist many similar scripts that capture UTM tags (utm_medium, etc) but not any custom parameters. They are not helpful if you want to track a custom parameter such as referral
, promo
, ref
, search
, and so on.
This script captures and saves any parameter in the URL, then inserts the value of that parameter into any form on your site that has a name
that matches the parameter key. You can make the form field hidden since it is filled in automatically and does not need any input from the visitor.