User Feedback Survey Pre-Segmentation
Target Feature Management rules based on how visitors interacted with a survey
Overview
User Feedback Survey pre-segmentation lets you target Feature Management (FM) rules at users based on their survey activity. For example, you can roll out a feature only to visitors who gave a low NPS score, or exclude visitors who already answered a feedback question.
In the dashboard, this condition type is labeled User Feedback Survey.
The Wingify SmartCode records survey activity in the browser.
Key features
Target users on the survey interaction events available in the dashboard (for example, question viewed, attempted, or submitted), and match on a specific answer to a question, or on any answer, when the event supports a response.
Prerequisites
- The Wingify SmartCode is installed on the same page as the FM JavaScript SDK.
- A User Feedback Survey is live on that page.
- The SmartCode and the SDK run on the same origin.
- User Feedback Survey pre-segmentation works only in the browser. It cannot run on server-side SDKs.
Enable User Feedback Survey pre-segmentation in FM
-
In the dashboard, open the rule’s targeting and add a User Feedback Survey condition.

-
Pick the survey, the question (if the event is question-scoped), and the event shown in the UI.
-
If the event includes a response (for example, Answered/submitted), choose the answer to match, or choose any answer.
SDK Usage
Using the cookie as the user ID
const wingifyClient = await init({
accountId: '123456',
sdkKey: '32-alpha-numeric-sdk-key',
isPulsePreSegmentEnabled: true,
});
// No user ID: for features with User Feedback Survey conditions,
// the SDK uses the _vwo_uuid cookie as the user ID.
const flag = await wingifyClient.getFlag('feature-key', {});
if (flag.isEnabled()) {
// Show the feature.
}Passing the cookie value yourself
You can also pass the cookie value yourself. The result is the same when it matches _vwo_uuid:
const wingifyClient = await init({
accountId: '123456',
sdkKey: '32-alpha-numeric-sdk-key',
isPulsePreSegmentEnabled: true,
});
const visitorId = /* read _vwo_uuid from document.cookie */;
const flag = await wingifyClient.getFlag('feature-key', { id: visitorId });
if (flag.isEnabled()) {
// Show the feature.
}trackEvent and setAttribute APIs
When isPulsePreSegmentEnabled is true, trackEvent and setAttribute can also adopt _vwo_uuid as context.id if you omit id. Unlike getFlag, this does not require the call to be tied to a feature with User Feedback Survey conditions—only the init flag.
// Cookie present, no id → SDK uses _vwo_uuid
await wingifyClient.trackEvent('purchase', {}, { value: 10 });
await wingifyClient.setAttribute({ plan: 'pro' }, {});Survey matching itself still happens only during flag evaluation (getFlag), not inside trackEvent / setAttribute.
Options and fields
| Option/field | Type | Required | Description |
|---|---|---|---|
| isPulsePreSegmentEnabled | Boolean | Yes, to use User Feedback Survey targeting | Pass true in init. Default is false. |
context.id (on getFlag) | String | No, for features with User Feedback Survey conditions | Leave empty to use the _vwo_uuid cookie, or pass the _vwo_uuid value. Any other value makes User Feedback Survey conditions evaluate as not matched. |
context.id (on trackEvent / setAttribute) | String | No, when isPulsePreSegmentEnabled is true | Leave empty to use _vwo_uuid if the cookie is present. If the flag is off, id is still required. |
Flow
The following steps describe what happens when you call getFlag with isPulsePreSegmentEnabled set to true:
flowchart TD
A[Call getFlag] --> B[Feature has a User Feedback survey condition?]
B -->|No| C[Flag evaluated as usual]
B -->|Yes| D{Context user matches the _vwo_uuid visitor?}
D -->|No| E[Survey condition does not match. Flag returned]
D -->|Yes| F[Check displayed, attempted, or submitted. Flag returned]
How the visitor is identified
Survey activity belongs to the SmartCode visitor identified by the _vwo_uuid cookie. Before evaluating User Feedback Survey conditions, the SDK makes sure the FE user is that same visitor.
getFlag
This table applies when isPulsePreSegmentEnabled is true and the feature uses User Feedback Survey conditions:
_vwo_uuid cookie | context.id | What the SDK does |
|---|---|---|
| Present | Not passed | Uses the cookie value as the user ID and evaluates User Feedback Survey conditions. |
| Present | Same value as the cookie | Evaluates User Feedback Survey conditions. |
| Present | Any other value | User Feedback Survey conditions don’t match. Evaluation still uses your id. |
| Missing | Passed | User Feedback Survey conditions don’t match. |
| Missing | Not passed | getFlag fails because there is no user ID, and returns a disabled flag. |
When the SDK uses the cookie value as the user ID, it uses it for everything in that getFlag call: bucketing, user storage, and the events sent to Wingify.
NoteOn
getFlag, the cookie is used as the user ID only for features that use User Feedback Survey conditions. For any other feature, or whenisPulsePreSegmentEnabledisfalse,getFlagstill requirescontext.id.
trackEvent and setAttribute
This table applies when isPulsePreSegmentEnabled is true (no per-feature check):
_vwo_uuid cookie | context.id | What the SDK does |
|---|---|---|
| Present | Not passed | Uses the cookie value as id (and the matching web uuid) and continues. |
| Present | Same value as the cookie | Continues with your id. |
| Present | Any other value | Logs a mismatch; still uses your id and continues. |
| Missing | Passed | Continues with your id. |
| Missing | Not passed | Invalid context; the call does not proceed. |
When isPulsePreSegmentEnabled is false or omitted, context.id remains required for both APIs.
Events you can target
Use the event options shown in the dashboard for User Feedback Survey (for example, viewed, attempted, answered/submitted).
- Presence-style events (such as
viewedorattempted) match whether the interaction happened. - Answer-style events (such as
answeredsubmitted) can match a specific response or any response.
Points to note
Updated about 10 hours ago