Contents

Create Your Own Survey Today

Free, easy-to-use survey builder with no response limits. Start collecting feedback in minutes.

Get started free
Logo SurveyNinja

Hidden variables

Picture this: an online store sends a satisfaction survey to 10,000 customers. Everyone gets the same link and answers the same questions.

A week later — 1,200 responses. The analyst opens the data and sees ratings, comments, answers to questions. But not the most important thing: who are these people? What plan are they on? Which city are they from? How many orders have they placed? To find out, you either have to add 5 extra questions to the survey (and lose part of your respondents) or manually match responses against the CRM database by email. Both options are a headache. Yet the solution is dead simple: pass all the information you need along with the link — as hidden variables. The respondent never sees them, never fills them in, never spends time on them — but the data is automatically attached to every response.

What hidden variables are

Hidden variables (URL parameters, embedded data) are data passed into a survey through URL parameters and automatically attached to the respondent's answer while remaining invisible to them. The respondent has no idea that, along with their answers, information about their segment, traffic source, CRM identifier, or any other data embedded in the link is being saved.

Technically it works in a simple way. A regular survey link looks like this: https://surveyninja.io/s/abc123. A link with hidden variables: https://surveyninja.io/s/abc123?city=london&plan=business&client_id=7842. When the respondent follows the second link and completes the survey, three fields are automatically added to their answers: city — London, plan — Business, client ID — 7842. The respondent filled in nothing, but the analyst gets all the information needed for segmentation.

Why hidden variables are useful

Segmentation without extra questions

Every additional question in a survey lowers your Response Rate. Questions like "Which city are you from?" or "What plan are you on?" are annoying, because the company already knows the answer. Hidden variables let you get segmentation data without a single extra question. The respondent goes through a short, pleasant survey — and the data already contains everything needed for deep analysis.

Survey personalization

Hidden variables can be used not only for analytics but inside the survey itself. Pass the customer's name in the URL — and the first screen addresses them personally: "Alex, tell us about your experience with us." Pass the product name — and the questions plug it in automatically: "How would you rate the quality of [Business plan]?" Personalization boosts engagement and conversion.

Tracking the source

If you distribute a survey through several channels at once — email, website, social media, QR code — hidden variables show you where each response came from. Add the parameter ?source=email to the link for your mailing and ?source=website to the link on your site — and during analysis you know exactly which channel produced more responses, where ratings are higher, and where the audience differs.

Linking with a CRM and external systems

Pass the client ID through a hidden variable — and responses can be automatically linked to a record in your CRM, with no manual matching by email. Through webhooks or the API, survey data together with hidden variables flows back into the CRM in real time. The manager sees: customer 7842 gave an NPS of 3 and wrote "delivery took too long" — and can react instantly.

Logic jumps based on external data

Hidden variables can control the route inside a survey. Pass ?role=manager — the respondent sees questions for managers. Pass ?role=developer — a different set of questions. One survey, several routes — with no need to create separate forms for each segment. This works through logic jumps based on the value of a hidden variable.

Practical use scenarios

Personalized email campaign. The CRM generates a unique link for each customer: ?name=Alex&city=London&segment=premium&client_id=7842. The customer opens the email, follows the link, sees a personalized survey. Their answers are automatically tied to their CRM profile. No more "enter your email for identification."

A/B testing your invitations. You send two versions of the invitation email: a formal tone in the first, an informal one in the second. You add ?variant=formal and ?variant=informal to the links. Once the data is collected, you compare: which version produced more responses, whether one group rates you higher, whether comment depth differs.

Offline + online. Each point of sale gets its own QR code with a hidden variable ?store=downtown, ?store=mall. The customer scans the code, takes the survey — and the data automatically records which store they were in. No need for a "Which store did you make your purchase at?" question — the answer is already in the link.

Triggered surveys. The CRM sends a survey automatically after a support ticket is closed. The link carries the ticket number, the agent's name, the request category. The analyst doesn't just see "the customer gave 2 out of 5," but "the customer gave 2 after a request in the "returns" category, agent — Ivanov, ticket #4521." That is data you can act on.

How to set up hidden variables in SurveyNinja

In the SurveyNinja builder, hidden variables are set up in a few clicks — a detailed guide is available in the help center.

Step 1. In the survey settings, add hidden variables: set a name (for example, city, plan, client_id) and, if needed, a default value.

Step 2. Build the links with parameters. If you send them through a CRM, set up a link template that substitutes data from the customer's record. If you place a QR code, set the parameters manually for each location.

Step 3. During analysis, use filtering by hidden variables: show only responses from London, only customers on the "Business" plan, only responses from the email channel. The data can be exported with all hidden variables included.

Common mistakes

Passing personal data in plain sight. A link with the parameter [email protected]&phone=15550123456 is a bad idea. The URL is visible in browser history, server logs, and analytics systems. Pass identifiers (client_id), not the personal data itself. The matching to a profile happens on the CRM side, not in the URL.

Not setting a default value. If a respondent follows a link without parameters (copied it from a chat, forwarded it to a colleague), the hidden variables will be empty. Set a default value — for example, source=direct — so that such responses don't get lost in analytics but land in a separate category.

Too many variables. 15 parameters in a URL is technically possible, but it creates a fragile setup: a single typo breaks the link. Pass only what will actually be used in analysis. Usually 3–5 variables are more than enough.

Not checking the links before launch. A typo in a parameter name, incorrect encoding, an extra space — and the data doesn't get recorded. Always test: follow the link yourself, complete the survey, and verify that all the variables were saved correctly in the responses.

Forgetting about consent to data processing. Hidden variables may contain information that makes it possible to identify a respondent. If that is the case, you need to obtain consent to process personal data in accordance with applicable data protection laws.

Hidden variables are one of the most underrated tools in a researcher's arsenal. They cost nothing, don't make the survey longer, don't annoy respondents — and yet they turn an anonymized mass of responses into structured data tied to a segment, channel, customer, and context. If you're not using hidden variables yet — start with your next survey. The difference in your analytics will be noticeable.

1