Installing Connect Surveys on Headless Instances
Last updated
Last updated
There are multiple ways to configure and setup headless Connect. There are two main channels it supports:
on-site
post-checkout
Both channels support multiple different modes of configuration. Either by passing query string parameters to the script or by creating meta tags inside the page header.
To display an on site survey, the system chooses from a prioritised list of surveys for the on site channel. From highest priority down, the system choses the first active survey that matches conditions and that the user is eligible for answering.
To implement on site surveys, you can add our surveys script tag to the header of the page(s) with your store Shopify domain.
These query string parameters can be added to the script src.
shop
The store identifier for example okendo-seahorse-emporium.myshopify.com
string
channel
The Okendo Survey channel to load a list of surveys from.
string
on-site
, post-checkout
auto_initialise
Flag to indicate if the API setup function should be run on page load. Defaults to false
boolean
true
, false
customEventsOnly
Flag to indicate if page event triggers to show surveys should be supressed. Defaults to false
boolean
true
, false
targetElementId
Optional page element id to place the survey inside of.
string
To display a post checkout survey, the system chooses from a prioritised list of surveys for the post checkout channel. From highest priority down, the system choses the first active survey that matches conditions and that the user is eligible for answering.
Post-checkout requires extra data needed for the decision making process on which survey to display to a customer. This data is used to determine which post-checkout conditions and triggers match.
If only using a simple post checkout survey without conditions you can use the same setup as the above on site section.
If you want to use any of the following conditions, you will need to either use the javascript API properties or meta tags as explained below:
Order value is at least
Order value is at most
Purchased product
Cart contents do not include
New Customers
Repeat Customers
The channel parameter needs to be provided as a query string parameter to the script src.
channel
The Okendo Survey channel to load a list of surveys from.
string
on-site
, post-checkout
oke:subscriber_id
Your Okendo subscriberId.
00000000-0000-0000-0000-000000000000
oke:target_element_id
The id you have given the element on the page where you want embedded surveys to be displayed. Only required for embedded.
okendo-survey
oke:order_id
The order id used to support revenue attribution and linking the order to the survey response. See Shopify.checkout.order_id
5179739177206
oke:order_subtotal_price
The order value to be used for matching order value conditions. Value should match your store currency.
100
oke:cart_content_product_ids
A list of product ids being purchased. Used for cart contains or not contains conditions. Separate by commas.
6911181521050, 6911187714202
oke:auto_initialise
Flag to indicate if the API setup function should be run on page load. If not included you will have to manually call setup
on the Javascript API window object okeConnectApi
See the link below for details on API references to support your custom implementation.