- Suggested-question buttons. Add
data-roserx-questionto a button. Clicking it asks that question. - Your own question box. Send whatever the visitor types into a field on your page with
window.RoseRx.open({ question }). - Question links. Add
?roserx_question=...to your page’s address, for example in an email or an ad, to open the chat with that question.
Before you start
- Your widget is saved and its status is Active.
- The RoseRx embed script is installed on the same page. See Embedding Your Widget.
Suggested-question buttons
Add thedata-roserx-question attribute to a button, set to the question it should ask. Add hidden as well, so the button only appears once the widget is ready to answer.
- Buttons stay hidden until the widget is ready. The embed script removes
hiddenonce the widget has loaded. If the widget cannot load, for example because it is inactive or the domain is not allowed, the buttons never appear, so visitors never see a button that does nothing. - Clicks inside the button count. If your button contains an icon or a
<span>, clicking those asks the question too. - The element’s own click behavior is canceled. A link with the attribute does not navigate anywhere.
hidden attribute, for example with a display rule on all buttons, add this rule so the buttons stay hidden until the widget is ready:
Buttons your page adds later
The embed script reveals hidden buttons once, when the widget becomes ready. A button your page adds after that, for example from a single-page app or a modal, would stay hidden. For those buttons, leave outhidden and hide them with the data-roserx-ready CSS rule instead:
data-roserx-ready to the page’s <html> element once the widget can take a question.
Your own question box
If your page has its own “Ask a question” field, send what the visitor typed withwindow.RoseRx.open():
open() takes either a question or a flow, not both. If you pass both, the Appointment Finder starts and the question is ignored.
Question links
Addroserx_question to the address of any page that has the widget. When someone follows the link, the widget opens with that question.
%20 and ? becomes %3F.
A link only sends questions your page offers
Anyone can write a link to your page, so a link is only allowed to send a question that your page itself offers. Otherwise the text is placed in the chat box, unsent, and the visitor chooses whether to press Send. A question counts as offered when it exactly matches either:- the
data-roserx-questionvalue of a suggested-question button on the page, or - an entry in a hidden approved list on the page.
The match is exact, including capital letters and punctuation. Spaces at the start and end are ignored.
roserx_question parameter is removed from the address bar as soon as the page loads, so the question is not kept in the visitor’s address bar or recorded with the page URL. Other parameters, such as UTM tags, are left in place.
How questions are handled
- Sent exactly as written. The question becomes the visitor’s message, word for word. If the visitor already has a conversation in progress, the question is added to it.
- Same safety checks as a typed message. Guardrails and adverse event detection apply in the same way.
- Long questions are never cut short. A question longer than 2,000 characters is placed in the chat box, unsent, for the visitor to review.
- Questions asked mid-answer wait. If the agent is still answering, or the Appointment Finder is starting, the question is placed in the chat box for the visitor to send.
- HCP verification comes first. On a widget with HCP Verification, the question is held until the visitor is verified and then sent once. Reloading the page before verifying drops it.
More than one widget on a page
Adddata-roserx-widget to name the widget that should answer, in the same way as for custom buttons:
- A button without
data-roserx-widgetgoes to the widget whose embed script loaded last. - A question link also goes to the widget whose embed script loaded last. Buttons and approved lists that name a different widget do not count toward what the link may send.
data-roserx-readyis set when the widget whose embed script loaded last is ready.
Troubleshooting
A link opens the chat but doesn't send the question
A link opens the chat but doesn't send the question
- The question must exactly match a suggested-question button or an entry in the
<template data-roserx-questions>list on that page, including capital letters and punctuation. - Check the question is URL-encoded in the link.
- On a page with more than one widget, the link goes to the widget whose embed script loaded last. Check the button or list is not named for a different widget.
The question appears in the chat box instead of being sent
The question appears in the chat box instead of being sent
- The question is longer than 2,000 characters, the agent was still answering, or the question came from a link the page has not approved. The visitor can press Send.
The console says window.RoseRx is undefined
The console says window.RoseRx is undefined
- The embed script had not finished loading when your code ran. Guard the call with
if (window.RoseRx && window.RoseRx.open), and keep your question box hidden untildata-roserx-readyis set.
Next steps
Custom Buttons
Open the widget, or the Appointment Finder, from your own buttons and links.
Embedding Your Widget
Install the embed script and set up domain restrictions.

