Publishing Your Survey
There are a few ways to publish your survey to your customers. You can embed the survey on your store if you are on Shopify, or share the survey link directly with your customers. You can also embed the survey anywhere on your website or app by using the provided embed code.
Share the Survey Link
You can share the survey link directly with your users. To get the survey link, go to the Distribution page of your survey and copy the Standalone Survey URL. You can share this link on your website, social media, email campaigns or chat apps like WhatsApp and iMessage.
![Standalone Survey URL](/assets/standalone-survey-BInaeEJp.png)
Embed on Shopify (Checkout Extension)
Scope provides a Shopify app that allows you to easily embed your survey on your Thank You and Order Status pages. Before you start, please copy the Survey ID from the survey you want to embed which can be found on the Distribution page.
- Make sure you have already installed the Scope Shopify app on your Shopify store.
- Go to the Online Store > Themes section in your Shopify admin dashboard.
- On the currently active theme, click on the Customize button.
- In the theme editor, locate the Pages dropdown menu and select Checkout and customer accounts.
- Once the page is loaded, click on the Checkout dropwn menu and select Thank you.
- On the left side of the screen, click on the Sections tab.
- Click on the Add app block button on either the Order Details or Order Summary section and select Scope in the list of available apps.
- Paste the Survey ID in the Survey ID field and click Save.
Repeat the same steps for the Order Status page to embed the survey on the Order Status page.
Tips
We recommend choosing the Order Details section to display the survey. This will ensure that the survey is displayed above other content and is more visible to the customer.
Embed on Website or App
You can embed the survey on any website or app by adding the following code within the <head>
of your HTML page.
<script>
(function (window, document) {
'use strict';
window.scopeConfig = {
apiKey: '<PUBLIC_API_KEY>',
surveyId: '<SURVEY_ID>',
};
const script = document.createElement('script');
script.src = 'https://scpe.io/embed.js';
script.fetchPriority = 'high';
document.head.appendChild(script);
})(window, document);
</script>
Within the <body>
of your HTML page:
<div data-scope></div>
By default, the survey will look for a container with data-scope
attribute and append the survey to it. You can override this behavior by passing the target
key in the window.scopeConfig
object.
You can find your Public API Key from your Settings > API Keys page.
![Public API Key](/assets/public-api-key-Bb-e0j0o.png)
Extending your survey
The window.scopeConfig
object allows you to pass additional information to the survey. The following values are supported:
Key | Type | Description | Example |
---|---|---|---|
target | string | The HTML element that the survey will be appended to. | '#survey-container' |
platform | string | The platform where your order data resides. If the platform is set to shopify , we will automatically fetch the Order & Customer details from Shopify based on the supplied orderID . | 'shopify' |
channel | string | The channel where the survey is embedded. | 'web' |
externalId | string | The unique identifier of the user. | '12345' |
company | string | The company name of the user. | 'Scope' |
string | The email address of the user. | 'demo@example.com' | |
phone | string | The phone number of the user. | '+1234567890' |
firstName | string | The first name of the user. | 'John' |
lastName | string | The last name of the user. | 'Doe |
gender | string | Gender of the user | 'Female' |
dob | string | Date of birth of the user | '1990-01-01' |
city | string | City | 'New York' |
state | string | State | 'NY' |
postcode | string | Postcode | '10001' |
country | string | Country | 'United States' |
countryCode | string | 2-letter country code | 'US' |
orderId | string | Order ID | '123456789' |
orderTotal | float | Total amount of the order | 100.00 |
discountTotal | float | Total discount applied to the order | 10.00 |
discountCode | string | Discount code applied to the order | 'SAVE10' |
productIds | array | Array of product IDs in the order | [12345, 67890] |
orderCurrency | string | Currency of the order | 'USD' |