In most cases, it’s best to connect respondent feedback to information that you have available elsewhere as much as possible. You can add custom variables to your surveys to track specific data about your respondents, such as their subscription type, previous page, and more.
Custom variables are pieces of data that you can include when someone leaves feedback through a button or campaign. They can derive from other 3rd party tools or from your own website. Custom variables are used to add extra information about your respondents or the website, email, or mobile app respondents left feedback about.
Connecting feedback to data from other sources helps you to:
You can also use custom variables to accurately target people with your survey. For example, you can use custom variables to survey people between 25 and 40 years old and have purchased a specific product in the past.
You can add custom variables to web, app, and email widget forms. However, the implementation, display, and analysis options differ for each form type.
Custom variables are structured in key-value pairs. The variable key is the name of the variable and is matched with a value. The following list shows examples of custom variable structures:
Once implemented, custom variables will be available in app.usabilla.com for each feedback item to which they were added. GetFeedback only stores custom variables when someone submits a response.
A maximum of 488 characters can be included in a custom variable for both the feedback button and campaigns.
Custom variables allow you to enrich your feedback with data from other sources by passing these on data along with the feedback item. This means that you can add extra information such as usernames, customer types or A/B test variables to your feedback. Having these data in the same place as your feedback, will help you to connect the dots and analyze your feedback quicker and more extensively.
Custom variables can include any sort of data, provided that:
It’s best to only send data to GetFeedback if you are actually planning to use it. This will help you to keep your feedback clean and help you meet data privacy requirements such as the General Data Protection Regulation (GDPR).
If you want to add data which could potentially be used to identify individuals (e.g. user IDs or usernames), consider including a hashed or encrypted version of the data. You will be able to recognize the user that left feedback, but no one outside your organization will be able to do so.
To help you analyze data later, it’s best to keep the custom variables short and comprehensive. Keep in mind that custom variables can be used to filter and categorize your feedback.
You can also use custom variables for more specific use cases. Some examples of advanced usage are listed below:
Custom variables add extra information about your respondent or the application. You can also use them to target a specific group of visitors with your app campaign.
You can target based on multiple custom variables at the same time. These work based on AND logic, so all custom variables have to match to trigger the campaign.
For example, you could target the following custom variables:
To use custom variables to target your app campaign:
Learn more about creating app campaigns
Add custom variables to web feedback buttons and campaigns to collect specific data with feedback items and campaign results.
Examples of Custom Variables are user names, session IDs, A/B-testing variables from other tools, demographic data, and membership statuses.
The following JavaScript API call can be included on every page on which you would like to include Custom Variables. Please ensure the call is installed on every page below the GetFeedback Digital code.
In this example, Username and SessionID are the custom variable names that will appear in GetFeedback, while the values indicate a reference to the variable.
The API call can be used multiple times. Any call replaces the data of the previous call. The last call’s data will be used when the feedback process is started.
To make it easier to update custom variables, use a JavaScript Object to store the custom variables. If you update the object and resend the custom variables using the JavaScript object, you can easily keep custom variables up to date or even append values. The code sample below shows how you might accomplish this.
If you use our Salesforce integration and want to push custom variables into your Salesforce environment, you will need to use one of the predefined custom variable field names instead of defining your own. There are a total of 5 predefined field names for variables in the Salesforce app. Learn more
Example: You want to send the Username and Session ID variables to Salesforce. To make these variables available in Salesforce, your code should use one the predefined variable field names like this:
When you use our JavaScript API call to send custom variables to GetFeedback, you can pass on the following 2 objects:
Arrays and objects can have a maximum depth of 2 and must consist of uniform values (only strings, only integers etc.).
TIP! It’s best to avoid using objects or arrays. Using only uniform values allows you to easily compare and export feedback and campaign results.
The custom variables will now be included in every feedback item and campaign result. Also, you can use the custom variables to target campaigns to specific visitors.
Once you set up your custom variables, you can target campaigns based on the custom variables. For example, if your users have individual profiles on your website, you can set a campaign to trigger based on profile variables such as age, gender, or membership status.
To target custom variables in a campaign:
You can add your own custom variables to full survey campaign links. These custom variables can be whatever you want them to be. For example, you can specify the campaign you’ve added the variable to.
To add custom variables to your full screen campaign:
Once a respondent completes the survey, the variables are stored in an extra column in the campaign results.
Use the document.referrer custom variable to target visitors based on their previous page. This targeting option can be useful in many ways, as shown in the examples below:
The document.referrer only works for multi-page websites, so it doesn’t work for single page applications. Check with your Customer Success Manager to confirm your website doesn’t block this functionality.
Add document.referrer to your web pages as a custom variable using JavaScript. The code sample below shows how to add the variable to your page. Make sure to initialize the JavaScript after the feedback button has been loaded.
To target the document.referrer variable in a campaign:
By default, all feedback from In-Page widgets contain metadata to identify, sort, and manage your feedback. You can also collect additional information using custom variables.
To use custom variables with in-page surveys:
As soon as you enable the custom variables, you can use them in your In-Page widgets. By default, we show 3 predefined custom variables: Category, Subcategory, and Item. You can use these custom variables to filter your feedback on the feedback page.
In addition to the three predefined custom variables, you can also add more custom variables by manually editing the widget code on your page. Add an additional attribute to the widget code with a predefined prefix using the format below:
In this example, the variable would be named exampleName and the value would be exampleValue.
Supplement feedback from your In-Page survey with information you already have about your respondents or your website. This information can be passed to GetFeedback through custom variables so every new In-Page feedback item will include your custom variables.
To dynamically add custom variables to in-page surveys:
With app.usabilla.com, embedded email surveys can help you gather feedback on emails, such as newsletters or customer support emails. Add custom variables to email surveys to collect more info about the feedback, such as the newsletter version your respondents left feedback on or which support agent they worked with.
To use custom variables in email surveys, your email client needs to support HTML in your email template (footer, signature, etc.).
Static custom variables have a predefined name and value. For example, you may add a custom variable for surveys that members in the 'Silver' tier will see. The name of your custom variable would be 'Tier,' and the value would be Silver. Static custom variables are added to all feedback submitted through the form.
Dynamic custom variables only have a predefined name; the value may be different depending on the respondent. The value uses a placeholder that can be read by the email client you're using. When someone submits feedback through the form, the custom variable value will be whatever information is supplied through the placeholder.
For example, you may send a newsletter to all of your members in different tiers. When members from the 'Gold' tier give feedback, the value of the Custom Variable will be 'Gold,' but when members from the 'Silver' tier give feedback, the value of the Custom Variable will be 'Silver'.
To use dynamic custom variables, your email client needs to allow the use of variables as placeholders. Contact your email client if you need more information.
To add custom variables to embedded email surveys:
Example:
A static custom variable may look like: &Tier=Silver
- Tier, name of the variable, which you define.
- Silver, value of the variable, which you define.
A dynamic custom variable will look different based on the email provider you use. For example, in Frontapp, a dynamic custom variable may look like this: &Recipient={{recipient.email}}
- Recipient, name of the variable, which you define.
- {{recipient.email}}, value of the variable, which will be replaced with the recipient’s email address because the email client recognizes it.
If you use our Salesforce integration and want to push custom variables into your Salesforce environment, you will need to use one of the predefined custom variable field names instead of defining your own. There are a total of 5 predefined field names for variables in the Salesforce app. Learn more
Example: To make the recipient email variable available in Salesforce, your code should use one the pre-defined variable field names like this:
&integration_sf_01={{recipient.email}}