Intercept surveys can be embedded on the website in two ways:
1. When a partial page is loaded (Single page applications/React Applications)
Intercept surveys can be embedded on the website through the JavaScript code. You can copy the code on the first page of your website (eg. index.html) and then call the loadSettings() function from the place you want to trigger the intercept, for example componentDidMount function.To embed an Intercept on your website, go to the intercept and follow the steps given below:
2. When a full page is loaded (the page you put the script on should load completely for intercept surveys to render)
Intercept surveys can be embedded on the website through the JavaScript code. You can copy the code on any page of your website.To embed an Intercept on your website, go to the intercept and follow the steps given below:
To map any specific segment with the intercepts and collect the responses for that segment, you need to pass the segment code in the intercept script embedded.
Here's the example: window.QPROSurvey = {};window.QPROSurvey.settings = {inID : "abc", segmentCode : "S1"};https://questionpro.com
In the above script, replace the value of segment code 'S1' with the values of segment for which you want to collect the responses.