Skip to main content
Visitors don’t have to open the widget first and then type. Your page can offer the question itself: the widget opens on the Chat tab and sends the question for them, exactly as if they had typed it. There are three ways to do it:
  • Suggested-question buttons. Add data-roserx-question to 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.
The wording of every question lives in your page, so you can change it whenever you like without touching the widget’s settings.

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.
The Embed tab in the widget editor shows ready-to-copy examples under Question box and suggested questions. Each example already includes that widget’s ID.

Suggested-question buttons

Add the data-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.
When a visitor clicks a button, the widget opens on the Chat tab and sends the attribute’s text as their message. The button’s label can be different from the question it sends, as in the second example.
  • Buttons stay hidden until the widget is ready. The embed script removes hidden once 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.
If your site’s CSS shows elements that have the 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 out hidden and hide them with the data-roserx-ready CSS rule instead:
The embed script adds 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 with window.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. Add roserx_question to the address of any page that has the widget. When someone follows the link, the widget opens with that question.
Use this in emails, ads, QR codes, or links from other sites. Encode the question for a URL, so spaces become %20 and ? becomes %3F. 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-question value of a suggested-question button on the page, or
  • an entry in a hidden approved list on the page.
Use the approved list for questions you want links to send without showing a button for them:
The match is exact, including capital letters and punctuation. Spaces at the start and end are ignored.
The 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.
If your agent starts its intake questions automatically when the chat opens, a question from your page can take the place of that automatic start, or be read as the answer to the first intake question. Avoid suggested questions on pages where the widget begins with intake.

More than one widget on a page

Add data-roserx-widget to name the widget that should answer, in the same way as for custom buttons:
  • A button without data-roserx-widget goes 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-ready is set when the widget whose embed script loaded last is ready.

Troubleshooting

  • Confirm the RoseRx embed script is on the same page, the widget status is Active, and the page’s domain is in the allowed list if domain restrictions are enabled. Buttons stay hidden when the widget cannot load.
  • If the button has a data-roserx-widget attribute, check its value exactly matches the data-widget value in that widget’s embed code.
  • If your page adds the buttons after it loads, see Buttons your page adds later.
  • Check each button has the hidden attribute.
  • Your site’s CSS may be overriding hidden. Add [data-roserx-question][hidden] { display: none !important; }.
  • 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 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 until data-roserx-ready is 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.