Handling Multiple Feedback Widgets

If your account has more than one feedback widget configured (e.g. separate projects for different products, apps, or sections of your site), you can target a specific one directly from the JavaScript SDK using its project_key.

Default behavior (no project_key)

Without a project_key, Userback automatically picks the best-matching widget for the current page based on each widget's targeting rules (URL match, user segment, etc.). This is the same behavior as a single-widget setup — most integrations don't need to do anything differently.

Targeting a specific widget

Pass project_key as the last argument to openForm() or showLauncher() to explicitly switch to and open a specific project's widget, regardless of which one would normally be auto-selected:

// Open the bug form for a specific project
Userback.openForm('bug', 'form', 'PROJECT_KEY_A');

// Show the launcher for a different project
Userback.showLauncher('PROJECT_KEY_B');

You'll find each project's project_key in its dashboard URL app.userback.io/PROJECT_KEY/dashboard/ or under that project's settings.

Example:

document.querySelector('#billing-feedback-btn').addEventListener('click', 	() => {
    // Open the general feedback form for the billing project
    Userback.openForm('general', 'form', 'BILLING_PROJECT_KEY');
	}
);

document.querySelector('#feedback-btn').addEventListener('click', () => {
    // Open the general feedback form for the dashboard project
    Userback.openForm('general', 'form', 'DASHBOARD_PROJECT_KEY');
});

Each button opens the widget scoped to its own project — its own routing rules, form fields, and branding — without needing to reload the page or re-initialize the snippet.

Switching persists

Once you open or show a widget with a given project_key, that project becomes the active one for any subsequent openForm()/ showLauncher() call that omits project_key — so you don't need to pass it on every call once you've switched:

Case 1:

Userback.showLauncher('PROJECT_KEY_A'); // switches to and shows Project A
Userback.openForm('bug');   // still Project A, no need to repeat the key

Case 2:

Userback.openForm('bug', null, 'PROJECT_KEY_B'); // switches to Project B
Userback.hideLauncher(); // hides the launcher
Userback.showLauncher(); // shows the launcher for Project B

Need help? Visit the Help Center or use the chat bubble on this page to contact our support team.


Did this page help you?