Surveys - Connect Window API
Last updated
Last updated
The Connect Window API exposes public functions that can be called to setup or make configuration changes to surveys to be displayed on the page.
This is a list of all properties that can be set on the window API.
window.okeConnectApi.subscriberId
Okendo subscriber id for connecting to your store.
00000000-0000-0000-0000-000000000000
window.okeConnectApi.apiDomain
Shopify domain for connecting to your store.
{your-shopify-domain}
window.okeConnectApi.channel
The survey channel being implemented. on-site
or post-checkout
on-site
window.okeConnectApi.targetElementId
Optional target element id in which to display an embedded survey.
okendo-survey
window.okeConnectApi.checkout.orderId
Order id to associate with the customer and survey response.
5179739177206
window.okeConnectApi.checkout.subtotalPrice
Price of the order used for order value conditions as well as revenue attribution.
100
window.okeConnectApi.checkout.lineItems
An array of product ids being purchased. Used for cart content conditions.
112233, 112244
Initialises the surveys scripts on the page.
window.okeConnectApi.setup();
Before calling setup
, you should set the properties below.
window.okeConnectApi.subscriberId
Either subscriberId or apiDomain is required.
window.okeConnectApi.apiDomain
Either subscriberId or apiDomain is required.
window.okeConnectApi.channel
on-site
or post-checkout
window.okeConnectApi.targetElementId
An optional target element id to place an embedded survey in.
customEventsOnly
Supress all page event triggers to allow manually triggering custom event surveys after initialisation.
boolean
true
, false
❌
Raise a custom event to potentially trigger a given survey. Display frequency rules are followed by default which can prevent a survey from being displayed to a given user for example if they have already answered the survey in their session.
window.okeConnectApi.raiseCustomEvent('product-survey');
You should set one of these properties before you can raise a custom event.
window.okeConnectApi.subscriberId
Either subscriberId or apiDomain is required.
window.okeConnectApi.apiDomain
Either subscriberId or apiDomain is required.
eventName
The name of the event on the survey to show.
string
✅
forceShow
Flag to ignore all display rules and show the survey. Defaults to false
boolean
true
, false
❌
Raise an add to cart event to trigger any add to cart surveys or to support a remove from cart trigger later. Add and remove from cart events rely on a cached list of products to store state between events.
window.okeConnectApi.addToCart('11223344');
productId
The product id being added to cart.
string
✅
Raise a remove from cart event to trigger any remove from cart surveys.
window.okeConnectApi.removeFromCart('11223344');
productId
The product id being removed from cart.
string
✅