...
Replace [MOPINION_EVENT_NAME] by with one of the eight Mopinion Events.
Replace [YOUR_OWN_TO_BE_EXECUTED_SCRIPT] by with your own script.
In the remaining part of this article, we provide for all 8 events scripts to log the event variables and values in the browser console, push the event variables and values in the Google Tag Manager dataLayer and how that will look in the console/dataLayer.
...
Code Block | ||
---|---|---|
| ||
{event: "ready", key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]"} |
2. mopinion_will_show
With this event, you know when the feedback button is clicked on.
...
Code Block | ||
---|---|---|
| ||
{event: "will_show", key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
...
3. mopinion_shown
With this event, you know when the feedback form is shown.
...
Code Block | ||
---|---|---|
| ||
{event: "shown", key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
...
4. mopinion_will_hide
With this event, you know when the closing cross or an area outside of the feedback form is clicked on.
...
Code Block | ||
---|---|---|
| ||
{event: "will_hide", key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
5. mopinion_hidden
With this event, you know when the feedback form is hidden again.
...
Code Block | ||
---|---|---|
| ||
{event: "hidden", key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
6. mopinion_next
If your feedback form consists of multiple pages this event, will let you know when navigation to a next page takes place. It also makes all the feedback given until that point available.
...
Code Block | ||
---|---|---|
| ||
{event: "next", feedback: Array(#_OF_OBJECTS) {id: "[UNIQUE_SURVEY_BLOCK_ID]", label: "[IMPORT_VAR]", title: "[QUESTION]", type: "[DATAFIELD_TYPE]", value: "[VALUE]" }, {id: "[UNIQUE_SURVEY_BLOCK_ID]", label: "[IMPORT_VAR]", title: "[QUESTION]", type: "[DATAFIELD_TYPE]", value: "[VALUE]" }, etc. {label: "User Agent", type: "agent", value: [BROWSER_USER_AGENT] }, {label: "url" type: "url" value: [URL_WHERE_THE_FORM_IS_SHOWN] }, {label: "Page title" type: "category" value: [PAGE_TITLE_WHERE_THE_FORM_IS_SHOWN] }, {label: "Role" type: "role" value: 1 }, {label: "Survey" type: "category" value: [FORMNAME] }, {label: "Viewport" type: "viewport" value: [LENGTH x WIDTH] }, {label: "Form trigger" type: "category" value: [PASSIVE | PROACTIVE | EXIT] }, {label: "Form completion percentage" type: "form_completion" value: [PERCENTAGE_OF_PAGES_COMPLETED] }, {label: "Customer ID" type: "customer" value: [UNIQUE_ID_GENERATED_ON_] }, {label: "Survey ID" type: "id" value: [UNIQUE_SURVEY_RESULT_ID] } key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
7. mopinion_feedback_sent
...
Code Block | ||
---|---|---|
| ||
{event: "feedback_sent", feedback: Array(#_OF_OBJECTS) {id: "[UNIQUE_SURVEY_BLOCK_ID]", label: "[IMPORT_VAR]", title: "[QUESTION]", type: "[DATAFIELD_TYPE]", value: "[VALUE]" }, {id: "[UNIQUE_SURVEY_BLOCK_ID]", label: "[IMPORT_VAR]", title: "[QUESTION]", type: "[DATAFIELD_TYPE]", value: "[VALUE]" }, etc. {label: "User Agent", type: "agent", value: [BROWSER_USER_AGENT] }, {label: "url" type: "url" value: [URL_WHERE_THE_FORM_IS_SHOWN] }, {label: "Page title" type: "category" value: [PAGE_TITLE_WHERE_THE_FORM_IS_SHOWN] }, {label: "Role" type: "role" value: 1 }, {label: "Survey" type: "category" value: [FORMNAME] }, {label: "Viewport" type: "viewport" value: [LENGTH x WIDTH] }, {label: "Form trigger" type: "category" value: [PASSIVE | PROACTIVE | EXIT] }, {label: "Form completion percentage" type: "form_completion" value: [PERCENTAGE_OF_PAGES_COMPLETED] }, {label: "Customer ID" type: "customer" value: [UNIQUE_ID_GENERATED_ON_] }, {label: "Survey ID" type: "id" value: [UNIQUE_SURVEY_RESULT_ID] } key: "[UNIQUE_FORM_KEY]", formName: "[FORM_NAME]", triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
...
8. mopinion_redirect
With this event, you know when a link within a feedback form is clicked and to what page is being redirected.
...