The Survey script module in Spotler FeedbackPro generates JavaScript to display surveys on websites via pop-ups, embedded surveys and survey tabs. Scripts are created, configured, and exported for developer implementation.
In Publish & Embed, you will find the Survey script module that lets you create a JavaScript survey script that displays a FeedbackPro survey on your website or web application.
You use this module to select a survey, define when it appears, configure how it is shown, and generate a script for implementation. The module also lets you configure rules for visitor identification, display timing, frequency, exclusions, survey tab styling, and tracking.
Companies often use survey scripts to collect feedback at important moments in the customer journey. For example, a healthcare organization can invite website visitors to share feedback after finding support information, while an ecommerce company can ask visitors why they decided not to complete their purchase. SaaS platforms frequently use embedded surveys inside customer portals to measure satisfaction after users complete a task or interact with a new feature.
On this page, the following topics are covered:
Manage your survey scripts
Configure survey behaviour and display
Implement the survey script
Frequently asked questions
Web developer implementation required
The Survey script module creates the configuration and the script output, but the final implementation on a website or web application is typically completed by a web developer or implementation owner.
Manage your survey scripts
How to create a survey script?
To create a new survey script, go to Publish & Embed and open the Survey script module. Select Create script. A step-by-step plan will open:
-
Script name and survey: Set a name, choose a survey that must be used in the script, and decide whether visitors should be identified across visits. The script name is used to identify the configuration in Spotler FeedbackPro. The script name does not change how the script behaves after implementation.
-
Eligibility: Define display rules, when the survey may or may not be shown. Delay and Frequency limit can only be configured when Visitor identification is enabled in step 1.
-
Display - Display type: Choose a display type. Control how the survey appears during a visit.
-
Display - Survey tab: Configure the side tab that allows visitors to open the survey at any time. If enabled, this features adds a fixed tab on the side of the page that allows visitors to open the survey. It can be used on its own or alongside other display settings. You will find an example of the survey tab on the right of your screen.
-
Tracking: Define what information is stored and which additional data can be sent with the survey.
-
Review: After all configuration steps are completed, Spotler FeedbackPro shows a Configuration summary of the script setup and generates the script output. The summary helps you verify the complete configuration before deployment.
-
Script created: after finishing the configuration, you can copy the script snippet directly from the interface or download the script as a
.jsfile. Use this script for implementation on your website.
How to view or edit an existing survey script?
Once a survey script has been created in your environment, it is listed under Previously created scripts in the Survey script module.
Available options:
- View: Open the survey script and view the generated script configuration and output.
- Edit: Update the survey selection, display rules, styling, timing, tracking settings, or other script configuration options.
- Delete: Permanently remove the survey script from your environment.
- Activate / Deactivate: you can use the toggle at the bottom of the script card to activate or deactivate the survey script without deleting it. Useful if you want the script to be immediately disabled from your application, without losing its settings and/or visitor identification logs.
Configure survey behaviour and display
Visitor identification
Visitor identification lets the survey script recognize a visitor by a stable identifier. This is used to control display logic based on visit history and to apply rules consistently for the same person.
What is a personal identifier?
A personal identifier is a value passed into the script implementation, such as a user ID, account ID, or email address. The identifier must be stable so the software can recognize the same visitor across visits.
When visitor identification is enabled, the script expects a personalIdentifier value to be provided during implementation. Spotler FeedbackPro uses that value in the background to evaluate timing and frequency rules for the visitor.
What happens when no identifier is available?
You can configure fallback behavior for situations where no personalIdentifier is available.
- Show the survey when the identifier is missing.
- Do not show the survey when the identifier is missing.
This setting controls whether anonymous visitors remain eligible for the survey.
Use consistent identifiers
Visitor-based rules only work reliably when the same visitor is always sent with the same personal identifier value.
Eligibility (Display rules)
Display rules define when the survey appears and how often it can be shown. These rules are especially useful when you want to avoid showing the survey too early or too frequently.
- Delay rule: The delay rule defines how long the software must wait before showing the survey. You configure a time amount and a time unit, such as hours, days, or weeks. When visitor identification is enabled, the delay is evaluated from the first recorded moment linked to the personal identifier. The survey is only shown after the configured delay has passed.
- Frequency limit: The frequency limit defines how often a visitor can see the survey. For example, you can limit exposure to once in a selected time period. After the survey has been shown, the software suppresses it for that visitor until the configured frequency window has expired.
-
Metadata exclusion: Metadata exclusion prevents selected visitor groups from seeing the survey. You do this by defining one or more metadata key-value conditions. At runtime, the script checks the metadata object passed during the implementation by the website or application. If a visitor matches an exclusion condition, the survey is not shown.
Metadata exclusions are commonly used to suppress surveys for internal users, test traffic, specific account types, or visitors from certain regions. For example, you can exclude users with
package=enterprisewhen a survey should only target freemium users, exclude users withtype=reporting_userfrom a product NPS survey, or exclude visitors withcountry=DEwhen the survey should not be shown to German website visitors.
Display types
The display type determines how the survey is rendered in the user interface.
Option 1: Pop-up
A pop-up survey is shown as an overlay on top of the page content. This display type supports several trigger options.
- Time on page: shows the survey after a configured number of seconds.
- Exit intent: shows the survey when the visitor appears to leave the page.
- Scroll depth: shows the survey after the visitor reaches a configured scroll percentage.
- Custom trigger: opens the survey when a selected page element is clicked.
- Display probability: defines the percentage chance that the survey appears when the page loads.
Option 2: Embedded
An embedded survey is rendered inside a specific page element on the website or web application. The target element must exist in the implementation and must be referenced correctly by the script setup.
Option 3: No automatic display
With no automatic display, the survey does not open by itself. The survey can only be opened through the survey tab.
Survey tab
The survey tab adds a fixed button to the side of the page that allows visitors to open the survey at any time. The tab can be used on its own or together with other survey display settings.
You can customize the button text, background color, text color, border radius, and add a custom icon. You can also control when the tab is shown by making it visible to all visitors or only to visitors who meet the configured display rules.
The tab appears as a fixed element on the side of the website or web application.
Tracking
The tracking settings define which contextual page details are captured together with survey activity or responses.
| Tracking option | What it records |
| Page URL | The URL of the page where the survey was shown or answered. |
| Page Title | The page title taken from the document title at the time of display. |
| Referrer | The page or location from which the visitor arrived. |
These tracking fields provide context for analysis and remain separate from additional data values sent through the implementation.
Additional data (metadata)
With Additional data (metadata), you can segment survey responses, identify visitor or customer context, enrich reporting, and support more detailed analysis within FeedbackPro. These values must be whitelisted in your environment as metadata in order for them to be saved. This can be done via your profile menu in the top right corner, click My environment. From there, open the Meta data tab. Access to this section depends on your user permissions, so the required rights are needed to view or manage metadata settings.
Implement the survey script
How do you implement the script on your website?
The script must then be shared with the person responsible for implementation on the target website or web application. Add this information to your briefing:
- Add the script snippet to the website.
- Ensure it loads on every page where the survey may be displayed.
- Provide a visitor identifier if visitor identification is enabled.
- Ensure the website provides all metadata values required for eligibility rules.
- Optionally: include additional metadata to enrich survey responses (recommended).
If required data is missing, the survey may not appear as expected.
How do you test the script live on your website?
You can test a survey script directly on your website using demo mode. Demo mode bypasses all delay rules, frequency limits, and metadata exclusion conditions, so the survey is displayed immediately when the page loads. This allows you or your developer to verify that the script is implemented correctly without waiting for normal display rules to trigger.
Activate demo mode by adding the query parameter ?surveyscript=demo to the URL of the page where the survey script is implemented. When the page loads with this parameter, the survey appears immediately regardless of any configured rules.
Example:
https://www.yourwebsite.com/page?surveyscript=demo
Responses submitted while demo mode is active are automatically tagged as demo responses. This means test data can be identified and excluded from your reporting.
Version 3.0.9 or higher required for live testing
Demo mode is available in survey-loader version 3.0.9 and higher. If your script was created before this version, update the script source URL and integrity hash to the latest version. You can find the latest script version in your environment under Survey scripts. New scripts use the latest version by default.
FAQ
Yes, as long as the implementation matches the intended configuration and all required triggers, identifiers, and metadata are available where needed.
No. The script name is used to identify the script in Spotler FeedbackPro and does not change runtime behavior.
No. Visitor identification is optional, but it is needed when display logic depends on a stable identifier for the visitor.
Yes. You can configure the script with no automatic display and make the survey available through the survey tab only.