This guide shows how to add the Novella Website widget to your site so you can collect feedback and see privacy-conscious traffic context alongside survey responses.
Once installed, the Website widget can:
YOUR_WORKSPACE_KEY with your public Novella workspace key.</body> or in <head> with defer.<script
defer
src="https://surveys.novellahq.com/widgets/1.0/novella.js"
data-workspace="YOUR_WORKSPACE_KEY">
</script>
Once loaded, the script retrieves your active widget settings and evaluates their URL, trigger, priority, and frequency rules in the visitor's browser.
If your website or tag manager knows the visitor, you can pass optional personalization values.
<script
defer
src="https://surveys.novellahq.com/widgets/1.0/novella.js"
data-workspace="YOUR_WORKSPACE_KEY"
data-firstname="{{ first_name }}"
data-lastname="{{ last_name }}"
data-email="{{ email }}"
data-company="{{ company_name }}">
</script>
| Attribute | Purpose |
|---|---|
data-workspace | Required public key used to retrieve your active widgets. |
data-firstname | Optional first name of the respondent. |
data-lastname | Optional last name of the respondent. |
data-email | Optional email address of the respondent. |
data-company | Optional company name of the respondent. |
data-autoload | Set to false to wait for consent before starting the widget. |
data-analytics | Set to false to disable website pageviews. |
Personalization is included in an encrypted, short-lived widget token. The survey iframe URL and traffic event payload omit these values. Novella ignores unresolved template placeholders.
If your consent manager must authorize feedback or analytics before the widget starts, set data-autoload="false".
<script
defer
src="https://surveys.novellahq.com/widgets/1.0/novella.js"
data-workspace="YOUR_WORKSPACE_KEY"
data-autoload="false">
</script>
<script>
function onNovellaConsentGranted() {
window.NovellaWebsiteWidget?.load();
}
</script>
Call load() once consent is granted and the script is available. Until that call, the widget skips configuration requests and Novella website pageviews.
To keep feedback surveys enabled while disabling Novella's lightweight website analytics, set data-analytics="false".
<script
defer
src="https://surveys.novellahq.com/widgets/1.0/novella.js"
data-workspace="YOUR_WORKSPACE_KEY"
data-analytics="false">
</script>
Survey interaction events are still recorded after a respondent opens a survey.
When website analytics is enabled, the runtime records an initial pageview and distinct client-side route changes. Novella stores the following information.
When a visitor submits feedback, Novella can relate that sentiment to the page, referrer, and campaign context using shared visitor and session identifiers. Novella excludes IP addresses and user-agent strings from that matching process.
If your site uses Content Security Policy (CSP), merge these sources into the corresponding directives in your existing policy.
| Directive | Source to allow |
|---|---|
script-src | https://surveys.novellahq.com/widgets/1.0/novella.js |
connect-src | https://surveys.novellahq.com/api/widgets/ |
frame-src | https://surveys.novellahq.com |
Keep the other sources your application requires.
A security scanner may flag the widget script because it lacks an integrity attribute. Subresource Integrity (SRI) lets the browser check a downloaded script against an expected cryptographic hash before running it. If the script changes and its hash no longer matches, the browser blocks it.
For a script hosted on a different origin, SRI requires crossorigin="anonymous" on the script element and a response from the script host that allows the request through Cross-Origin Resource Sharing (CORS). The public Novella widget URL currently omits the required CORS header. Adding SRI attributes to the standard snippet would therefore block the widget.
If your organization's security policy requires SRI, contact Novella Support before changing the snippet. Share the page URL and the scanner finding so we can advise on your installation.
The widget detects navigation through history.pushState, history.replaceState, and browser back and forward navigation. It re-evaluates URL rules and records each distinct SPA URL once during the current page runtime.
If your application changes content without updating browser history, call refresh().
window.NovellaWebsiteWidget?.refresh();
novella.js loads successfully./api/widgets/config returns a successful response./api/widgets/track returns a successful response.Test consent-controlled installations both before and after consent is granted.
data-workspace contains the correct public workspace key.integrity attribute, also check for integrity or CORS errors.The current origin is unauthorized for the workspace, or the workspace lacks a valid primary domain. Use HTTPS and verify the domain in Novella.
Check whether frame-src permits https://surveys.novellahq.com. Widget frames use a dedicated, token-protected embed endpoint.
data-analytics="false". Remove that attribute to enable website pageviews.data-autoload="false", confirm your consent callback calls load()./api/widgets/track.website_events datasource and server-side ingestion credentials are configured.Inspect the rendered script element in your browser to verify that your application or tag manager resolved the personalization placeholders. Novella discards empty, invalid, and unresolved values.
You can manage widget presentation, survey selection, triggers, URL rules, and frequency in Novella. These settings normally take effect without changing your snippet. To remove the widget and website analytics entirely, remove the script element from your site or tag manager.