URL Variables in Surveys

Blocksurvey blog author
Mar 7, 2024 · 3 mins read

A lot of you might have come across URL variables in surveys. Some people find that to be a bit intimidating. It is not as hard as you’d think, so let’s dive right into it!

What are URL Variables?

It’s a piece of the URL you see at the top of your browser that some companies ask for when you take surveys. One example is ?ref which stands for "referral" - so if someone takes your survey and sends it in, they will get credit as a referral in your study.

URL variables explained

It all started with UTM (Urchin Tracking Module) parameters. These are just short pieces of code that one can add to links. UTM parameters are used to track the effectiveness of online marketing campaigns across traffic sources and publishing media. They were introduced by google analytics’ predecessor Urchin. Urchin was then acquired by google, forming google analytics. This might sound technical, but UTM parameters are actually very simple and easy to use. The source from which traffic comes can be evaluated. For example, utm_source=facebook, if the link is clicked from Facebook. Similarly, the type of channel driving the traffic can be evaluated through a variable called medium. For example, utm_medium=paid_social, if the link is through a paid social advertisement. The URL variables are also called custom variables or hidden variables. Custom because you can create anything on your own like a programming language. Hidden because it is on the URL and many times this is not known to the users. They are all one and the same. Let’s see how BlockSurvey put this to use for your surveys.

How to use URL variables in your survey

One can use Blocksurvey to create URL variables. These are available in the survey builder under ‘Variables’. By default, there are pre-defined variables that help you to measure conversions from channels and referrals on your surveys.

Below is a screenshot from BlockSurvey variables. The ref, source (UTM parameter), medium (UTM parameter), and result variables can be deleted if not of use. You can also create variables of your choice with new names.

Measure Conversion

Say, you have a survey and want to distribute it across social channels. You can set the unique channel name on the variable ‘medium’ as ‘Twitter’, ‘Reddit’ etc. By this, when someone answers your survey, you’ll know where the answer has come from. You can create this from the ‘Share’ screen → Customize link below. You’ll have unique links for the medium you are targeting.

Measure Referrals

Similar to measuring the medium or source where your answers have come from. You can use ref - meaning reference or referral for incentivizing your audience to refer others for your survey. How you can do this is by setting their name or email id or any unique id on to the survey URL.

Personalize Surveys

Let us say you have customer details with you. For example, you have the customer's name. You can pass the name from the URL to the variable, from the variable to the question using the ‘Recall’ function. This adds more personalization to the survey. So, when you share the URL, all you have to do is edit the name in the URL and you are all set. By this, you’ll have a personalized welcome message to every customer.

Assign messages and use them

One can also assign value to variables, allowing the variable to be reused in the display logic. Let us say you have a variable called result. You assign the value pass to the variable result. Now for a successful answer, you can set the display logic to show the variable result. This in turn will show the value pass. You can find below, that we have created 2 new variables. One for Welcome Message and One for Thanks Message.

Now we are referring to the created variables in the Welcome screen and Thank you screen using @ character, which is to invoke the recall function in BlockSurvey.

Here is the outcome we can see. The values of the variable in the Welcome screen and Thank you screen

How to auto-populate data in forms/surveys?

We can prefill answers to a question. This can be done by accessing

Share→Customize Link→Prefill answers

We select the first question (Your name?). We have provided the value “Johnson” for ‘Your Name?’.

Once the value is given. Click “Create Custom URL”. Follow the created URL.

Now “Johnson” is prefilled as the answer of “Your Name” in the survey, as below screenshot.

In this article, I have given an overview of how the URL variables work with Surveys, the various types of variables that are available, and the benefits of using these variables. We have also looked at some examples of URL variables in surveys, prefill answers in surveys. URL variables allow you to make your surveys much more flexible and relevant to your customers.

Interested in other BlockSurvey features? Visit BlockSurvey features template gallery.

Like what you see? Share with a friend.

blog author description

Sarath Shyamson

Sarath Shyamson is the customer success person at BlockSurvey and also heads the outreach. He enjoys volunteering for the church choir.


Explore more