Skip to main content

Questionnaire Integration

RxScale provides embeddable medical questionnaires that collect patient information for doctor consultations. These questionnaires can be created and customized through the RxScale Admin Tool.

Installation

On the questionnaire detail page in the Admin Tool, you’ll find an installation script. Questionnaire releases are versioned, allowing you to test new versions safely. Add the following to your page:
Replace YOUR_QUESTIONNAIRE_UID with the UID from your Admin Tool questionnaire detail page.
RxScale automatically renders the questionnaire and responds to its configured type:
  • Product Recommender — Displays a recommendation flow based on patient answers
  • Direct To Cart — Redirects users to the cart after completion (unless otherwise configured)

Event Hooks

RxScale supports optional JavaScript hooks that trigger on specific events. These hooks are independent and modular.

Window Event Handler

After a successful questionnaire submission, RxScale invokes a callback named rxscaleQuestionnaireCompleted:

DataLayer (Google Tag Manager)

RxScale pushes structured events into the dataLayer object for Google Tag Manager integration. Events are triggered on page transitions and upon questionnaire completion. Available variables:
  • nextStep — Next step identifier
  • previousStep — Previous step identifier
  • stepName — Current step name
  • questionnaireVersion — Questionnaire version
  • questionnaireName — Questionnaire name
  • questionnaireId — Questionnaire UID

Klaviyo Integration

The Klaviyo snippet must be installed on your webpage for this integration to function.
When a user answers a questionnaire, their response data can identify a Klaviyo profile or trigger an event via the existing Klaviyo SDK on your site.

Helium Integration

The Helium snippet must be installed on your webpage for this integration to function.
User responses can identify or create a Helium account, enabling features like pre-filling login fields based on previously submitted answers.

Attaching Submissions to Orders

To associate a questionnaire submission with a Shopify order, include identifying metadata in the order. The required information can be stored at the order level, on an order item, or — for bundles — on that item’s Shopify line item group.

Required Properties

Property names must match exactly. RxScale compares them character-for-character and is case-sensitive, so _anamnesis_uid (and every other key above) must be spelled precisely as shown — no typos, no altered casing, no leading/trailing whitespace, and no missing or extra underscore. If a name does not match exactly, RxScale silently ignores it and the submission is not linked to the order.
RxScale resolves these properties with a three-level fallback: the line item’s own property wins first, if present. If the item doesn’t have it, RxScale checks the property on the item’s Shopify line item group — the grouping Shopify uses for bundles, where several line items share one group and a group-level property applies to all of them. If neither is set, RxScale falls back to the order-level property.

Example: RxScale Questionnaire

Example: External Questionnaire Provider

Storing _anamnesis_uid at the order level allows Shopify to duplicate orders if needed (e.g., via reorder functionality).

Pharmacy Selection

To associate a selected pharmacy with a submission, send the pharmacy information to the RxScale API:
If the selected pharmacy receives data through an API integration (no email), pass an empty string for the value field.

Patient Status Check

After Shopify login, check when a patient last signed an anamnesis using their customer ID:
The questionnaire must be tagged with the intent in the Admin Tool for this to work.

Return Codes

Example response:

Acquisition funnel reporting

The Admin Tool reports a questionnaire acquisition funnel — submitted → order placed → order completed — measuring how anonymous questionnaire submissions convert into orders. A submission is linked to an order via the order item it produced.
Questionnaire submissions that are already attached to a patient are excluded from the funnel. They represent existing patients rather than new acquisition, so counting them would distort the conversion rates. Only anonymous acquisition submissions are counted, and the funnel is reported at the organisation level (acquisition submissions are not bound to a single shop until an order is placed).