The widget is your survey running inside your own website, without depending on anyone opening an email. You paste a snippet once and WiseData NPS handles the rest: when it shows up, to whom, how often and what happens after the answer.
This article follows one example from start to finish: Sanches Accounting wants to measure how satisfied its portal users are, at app.sanches.com.
Before you start
Three things must be ready:
- A survey with the Website / Embed channel selected in the Channels step. The code is only generated after the survey is saved β before that the screen shows "Save the survey to generate the installation code".
- Access to the domain's DNS (the panel where the domain is registered or hosted), to publish the record that proves the site is yours.
- Access to the site's HTML, or to a tag manager. If someone else maintains the site and the DNS, what you hand them is the record from step 2 and the code from step 3.
Embed does not work for eNPS or Competition surveys β the first is internal, the second is targeted, and neither makes sense open to any visitor. It also doesn't share a survey with email or WhatsApp: the website can only go together with the App channel.
The steps below appear numbered on the screen itself, in two places: in the survey's channels step, under Website / Embed configuration, and in Channels βΊ Embed Settings (only steps 1 and 2 there, since there's no survey to generate code for). Domains belong to the account, not the survey: verified once, they work for every survey.
Step 1 β Enter your site's domain
In Enter your site's domain, type the address β in our example, sanches.com β and click Add. You can paste the full URL: we strip the https:// and the path for you.
A domain also covers www and its subdomains. So sanches.com already authorizes www.sanches.com and app.sanches.com β Sanches does not need to register all three. That is why registering the root domain beats registering a specific subdomain.
How many domains fit depends on the plan: one on Free and on the free trial, two on Pro and unlimited from Business up. A domain not yet verified also counts.
Step 2 β Prove the domain is yours
As soon as the domain is on the list, the screen shows a TXT record with three fields β Type, Name and Value β, each with its own copy button. Create that record in the domain's DNS panel exactly as shown (the name starts with _wisedata-nps, so it doesn't touch your email records or other verifications you already have). Then come back and click Verify now.
DNS propagation takes from a few minutes to a few hours. Meanwhile the domain shows as Awaiting publication (we haven't checked yet) or Record not found (we checked and it wasn't there) β wait and verify again. Once it turns Verified, the record disappears from the screen.
While no domain is verified, nothing works. That is deliberate: without this proof, any account could register another company's domain and put a survey on its site, or any page could copy your snippet and contaminate your data. For the same reason, a domain already verified by another account cannot be registered; and if two accounts register the same domain, whoever verifies first keeps it β the other one is notified by email.
Don't delete the record afterwards. Ownership is re-checked periodically. If the TXT disappears, the widget keeps working, but the domain gets a warning on screen and the account's admins receive an email β publish the record again.
Step 3 β Copy the survey code
The code shows in Copy the code to your site, in the survey's channels step, and is only released once at least one domain is verified β until then it is greyed out, with no Copy code button, because installed earlier it would not load. On a saved survey, the same code is in the Widget code card, under the same rule: with no verified domain, the card stays locked and shows the Verify a domain in Channels link. It looks like this:
<script src="https://cdn.wisedatanps.com/embed/widget.min.js" data-survey="YOUR_SURVEY_ID" async></script>data-survey is what ties the snippet to that specific survey. Each survey has its own β do not reuse an old survey's snippet assuming it is the same.
Step 4 β Paste it into your site
Paste it right before the closing </body> tag, on every page where the survey should appear β the same instruction the screen shows next to the code. The async attribute keeps it from holding your page back.
Do not try to limit pages by choosing where to paste the snippet: that is what Page targeting in the survey settings is for, which accepts wildcards (/checkout/*) and whose deny list takes precedence over the allow list. Paste everywhere and filter in the panel β that is the path you can change later without touching the site.
Tell it who is answering
This is the step that changes the survey's value the most, and the only one the copied snippet does not include. As it comes, every answer arrives anonymous: you get the score, but not the person.
If your site has a logged-in area β like the Sanches portal β add the person's details to the tag itself:
<script src="https://cdn.wisedatanps.com/embed/widget.min.js" data-survey="YOUR_SURVEY_ID" data-user-id="8421" data-user-email="maria@company.com" data-user-name="Maria Andrade" data-user-traits='{"plan":"Pro","city":"GoiΓ’nia"}' async></script>You get three things out of it:
- The respondent's name shows on the feedback card and in the customer details, instead of "anonymous respondent".
- One person answers once, even switching browsers or computers β the check moves to
data-user-idinstead of the device. - Traits become analysis cuts: with
planfilled in, Sanches can read Pro customers' scores apart from basic ones. If a trait is namedphone, its value is used as the respondent's contact number.
Traits have a ceiling: up to 10 attributes, with simple values (text, number or yes/no). Anything beyond that is discarded silently, so don't use the field as a dump of user data β use the few labels you will actually segment by.
In anonymous surveys none of this shows in the panel: name, email and traits stay hidden even though they were sent. The promise of anonymity outranks identification.
Single-page apps (React, Vue, Angular)
On sites that change screens without reloading, the snippet runs once, on the first load. That has three practical consequences.
Identification arrives later. On first load the visitor usually isn't even logged in yet. For that case, tell the widget as soon as you know who the person is:
window.WiseDataNPS.identify({ id: '8421', email: 'maria@company.com', name: 'Maria Andrade', traits: { plan: 'Pro' } });You can call it before the widget finishes loading β the call is queued and picked up. And call it again when the user changes (sign out, sign in as someone else), otherwise the second person's answer lands under the first one's name.
When someone simply signs out, say so too:
window.WiseDataNPS.reset();Without it, the last user's identification stays in the widget's memory until the page reloads β and an answer given after they left arrives under the name of whoever is already gone. reset() only forgets who was identified: it does not close a survey already open on screen. That is the next item.
An open survey does not leave the screen on its own. It only disappears once the visitor answers or dismisses it β until then it rides along through your site's screen changes. If the survey is for logged-in people, mount the widget inside the logged-in area, not at the root of the application: at the root it stays up when the person is taken to public screens such as sign-in or password reset. And when they leave that area, take the survey with them:
document.querySelectorAll('.wdnps-container') .forEach(function (el) { el.remove(); }); window.WiseDataNPS.reset();Pay extra attention with the After time on page and Exit intent triggers: they can fire after the person has already moved on, and the survey shows up where you did not want it.
Page targeting and "after N pages" only see the first screen. With no reload, the evaluated URL is the entry one and the page count never advances. On these sites prefer the Immediate, After time on page or Exit intent triggers, and avoid relying on URL rules. Note that the URL recorded on the answer follows a different logic: it is the screen the person was on the moment they submitted, and it is what shows under Response Origin in the panel.
Choosing where the survey shows up
The display mode β Popup, Slide-in or Inline β is set in the survey settings and does not need repeating in the code. Popup opens centered after a few seconds; slide-in slides in at the bottom-right; inline lives inside the page itself, with no close button. For popup and slide-in, the Dismissal option decides whether the visitor Can close, Can only postpone or whether the survey is Required.
In inline mode the survey renders exactly where you pasted the snippet by default β no wrapper element needed. To send it elsewhere on the page, point at the element:
<script src="https://cdn.wisedatanps.com/embed/widget.min.js" data-survey="YOUR_SURVEY_ID" data-target="#survey-area" async></script>There is also data-mode, which forces a mode other than the configured one. Use it sparingly: the day someone changes the mode in the survey and nothing changes on the site, the answer will be that forgotten attribute in the HTML.
When the widget does not appear
The widget fails silently on purpose β it never breaks your page nor shows an error to the visitor. Check in this order, which is the order of frequency:
- Is the domain verified? This is cause number one. Under Channels βΊ Embed Settings, the domain must show as Verified β registered and Awaiting publication or Record not found does not load yet. Remember a root domain covers its subdomains, but that does not extend across different domains.
- Is the survey running? A draft, paused, finished or out-of-window survey shows nothing.
- Have you already answered or dismissed it? Whoever answers doesn't see it again, and whoever closes it enters the configured Snooze days after dismissal. To test as a fresh visitor, use a private window.
- Is the sampling rate low? At 20%, four out of five visitors see nothing β and that includes you.
- Does page targeting match the current URL? The deny list takes precedence over the allow list.
- Has the trigger fired? With exit intent on desktop, the widget only shows when the cursor leaves through the top of the screen; on mobile it waits ten seconds.
What each plan unlocks
The widget itself is available on every plan, and sends through it are unlimited β they don't consume the email or WhatsApp quota. What changes with the plan is:
- How many domains you can register: one on Free and on the free trial, two on Pro, unlimited from Business up. The screen lets you type more, but registration is refused above what your plan allows. To switch domains on a plan with a limit, remove the old one first.
- Display frequency (don't repeat the survey to the same person for N days) is available from Pro up and on the free trial; on Free the field shows as locked.
Where to go next
- Sending channels β how embed compares to email and WhatsApp, and each one's metrics.
- Creating and sending surveys β display rules, triggers and post-response actions, step by step.
- Results and reports β where to read the answers, including NPS by website page.
- Alerts β how to be notified the moment a detractor answers.
In short: register the domain, publish the TXT record and verify it, paste the survey snippet on every page of the site, add the logged-in person's details so you don't collect anonymous answers, and settle everything else β when it shows, to whom and how often β through the display rules in the panel, without touching the HTML again.