For each questionnaire that is displayed to the end user, a set of custom values (metadata) can be pushed.
Metadata can be added before displaying the questionnaire or after its display, as long as a questionnaire is displayed. If no questionnaire is displayed, metadata will not be saved.
Pushing metadata might be restricted based on the Application Plan:
Free Plans are NOT allowed to push custom metadata
Paid Plans can push any metadata they configure
One final step before we start installing the e-satisfaction JavaScript Library, we are going to need get the Questionnaire Id from the dashboard settings, as the screenshot displays:
Place the following script anywhere in your page. Make sure that e-satisfaction script is loaded.
Esat.updateMetadata("QUESTIONNAIRE_ID", {
responder: {
"email": "john@doe.com",
"visitor": true, // true for visitor, false for logged in user
"gender": "male",
"region": "The region of your visitor/customer"
},
questionnaire: {
"page": "The page where the questionnaire is displayed",
"mobile": true // true for mobile, false for desktop,
}
});
The above script refers to example metadata. You should change the values to the ones that correspond to your case.
You will have first to create your application metadata through your dashboard, in the section Application Metadata, and then use them during the installation process.
NOTE: The above script will push the metadata to the questionnaire instance that was displayed or will be displayed on the included page, based on the given questionnaire id. If the user navigates away from the page or the page is reloaded, but the script is not re-executed, and the questionnaire has not appeared to the user, no metadata are stored.
Based on our article regarding the data we collect, there is a set of metadata that we collect automatically to make sure we are providing the best experience to the end-user. These metadata are the following: