SoluCX Widget
The SoluCX widget allows you to integrate surveys directly into your website, providing an easy and efficient way to collect customer feedback.
Compatibility with Form Flex and Survey
The widget is compatible with Form Flex and Survey types, allowing flexibility in data collection according to your business needs.
Usage based on HTML example
To use the widget, add the following HTML code to your site:
How to use:
- Add the script above in the
<head>tag or before the closing<body>tag in your HTML. - Create the widget inside a
<script>tag.
Note: When added in the
<head>tag, it is necessary to check if the DOM has loaded or add the function in some dispatch method (for example, button click).
Widget Types
The available widget types are:
bottomBar: Displays the widget as a fixed bar at the bottom of the page.
In bottomBar mode, the widget is displayed as a fixed horizontal bar at the bottom of the page.
This means it remains visible while the user scrolls the page, ensuring the widget is always accessible.bottomBox: Displays the widget as a fixed box in the bottom right corner of the page.
In bottomBox mode, the widget is displayed as a fixed box in the bottom right corner of the page.
This allows the widget to be highlighted without interfering with the main content, ideal for capturing the user's attention.bottomBoxLeft: Displays the widget as a fixed box in the bottom left corner of the page.
In bottomBoxLeft mode, the widget is displayed as a fixed box in the bottom left corner of the page.
Like the bottomBox, it highlights the widget without interfering with the main content, but positioned on the left side.inline: Displays the widget embedded in the page content.
In inline mode, the widget is displayed directly within the existing layout.
This means it integrates seamlessly with the page content, without overlapping or covering other elements. It is ideal for when you want the widget to be part of the natural flow of the content.modal: Displays the widget as a modal centered on the page.
In modal mode, the widget is displayed as a centered modal window on the page.
This means it overlays the page content, capturing the user's full attention. It is ideal for when you want to ensure the user interacts with the widget before continuing to browse.
Initialization Parameters
The createSoluCXWidget function accepts the following parameters:
Parameter apiKey (string) Required
API key provided by SoluCX.
Example:
Parameter type (string) Required
Type of widget to be created. Accepted values:
inlinebottomBarbottomBox(positioned to the right by default)bottomBoxLeftmodal
Example:
Parameter data
transaction_id OR name AND (email OR phone) transaction_id OR customer_id transaction_id OR customer_id AND phone transaction_id OR customer_id AND email transaction_id transaction_id transaction_id Example:
Any field prefixed with param_ is considered an extra transaction parameter that can be used for traceability.
Parameter options
Important about Quarantine: The widget's quarantine control is based on the client's browser cookies. This means that quarantine is not 100% guaranteed, as the user can clear cookies, use different browsers, different devices, or incognito/private browsing mode. For scenarios that require strict quarantine control, we recommend implementing additional server-side validations.
Example:
Callbacks Configuration
The widget now supports callback functions that are triggered when specific events occur. Add them to your options object:
callbacks(object): Optional callback functions for widget events.onOpened(function): Called when the widget is opened. ReceivesuserIdas parameter.onClosed(function): Called when the widget is closed.onError(function): Called when an error occurs. Receives errormessageas parameter.onPageChanged(function): Called when the user navigates to a different page within the widget. Receivespageas parameter.onQuestionAnswered(function): Called when the user answers a question.onCompleted(function): Called when the widget is completed successfully. ReceivesuserIdas parameter.onPartialCompleted(function): Called when the widget is partially completed. ReceivesuserIdas parameter.onResize(function): Called when the widget is resized. Receivesheightas parameter.
Example with callbacks:
Complete Example:
Conclusion
By following the instructions above, you can quickly integrate and configure the SoluCX Widget in your application or website. Use the provided examples to adjust and customize the widget according to your data collection and customer feedback needs.
Handling the Widget Response
The createSoluCXWidget function returns a promise that resolves to an object with the following structure:
- status:
"success"or"error" - message: A string containing an error message if the status is
"error"
Example:
If you have any questions or encounter problems, please contact SoluCX support. Happy coding!