- Now you have generated the code, you just need to paste the code anywhere between the <head></head> tag of your HTML code to install the SurveySensum widget.
- After adding this code our SurveySensum widget is installed on your website/product and this exposes some methods.
- These are:
- The startSurvey(<JAVASCRIPT_TRIGGER>) : So this method is used start survey using javascript trigger.
- The setUserInfo(<userData>): In this method the userdata parameter is passed as an object. This object will be like this:
- Here Keys name should be exactly the same as the contact property name on our portal. These are case sensitive.
- RemoveUserInfo(): If any userInfo is present, then it will be erased from the memory.
- The closeSurvey(): If any survey is currently running, then it will be closed.
const userData = {
Name: 'Bernard Donley',
Email: 'bernard@company.com'
};
How to use these methods:
For using these methods you can access the SurveySensum widget in a window object. Like this:
- window.surveysensum.startSurvey(<JAVASCRIPT_TRIGGER>);
- window.surveysensum.setUserInfo(userData);