...
You can use the following JavaScript to display the event's output in the browser's console:
Code Block |
---|
|
document.addEventListener('mopinion_will_hide', function(e) {
console.log(e.detail)
}); |
Specific code to push the Event Object into the Google Tag Manager dataLayer:
Code Block |
---|
|
<script type="text/javascript">
document.addEventListener('mopinion_will_hide', function(e) {
dataLayer.push(e.detail)
});
</script> |
The result in the console / dataLayer:
Code Block |
---|
|
{event: "will_hide",
key: "[UNIQUE_FORM_KEY]",
formName: "[FORM_NAME]",
triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
...
You can use the following JavaScript to display the event's output in the browser's console:
Code Block |
---|
|
document.addEventListener('mopinion_hidden', function(e) {
console.log(e.detail)
}); |
Specific code to push the Event Object into the Google Tag Manager dataLayer:
Code Block |
---|
|
<script type="text/javascript">
document.addEventListener('mopinion_hidden', function(e) {
dataLayer.push(e.detail)
});
</script> |
The result in the console / dataLayer:
Code Block |
---|
|
{event: "hidden",
key: "[UNIQUE_FORM_KEY]",
formName: "[FORM_NAME]",
triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"} |
...
You can use the following JavaScript to display the event's output in the browser's console:
Code Block |
---|
|
document.addEventListener('mopinion_next', function(e) {
console.log(e.detail)
}); |
Specific code to push the Event Object into the Google Tag Manager dataLayer:
Code Block |
---|
|
<script type="text/javascript">
document.addEventListener('mopinion_next', function(e) {
dataLayer.push(e.detail)
});
</script> |
The result in the console / dataLayer:
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]"} |
...
You can use the following JavaScript to display the event's output in the browser's console:
Code Block |
---|
|
document.addEventListener('mopinion_feedback_sent', function(e) {
console.log(e.detail)
}); |
Specific code to push the Event Object into the Google Tag Manager dataLayer:
Code Block |
---|
|
<script type="text/javascript">
document.addEventListener('mopinion_feedback_sent', function(e) {
dataLayer.push(e.detail)
});
</script> |
The result in the console / dataLayer:
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]"} |
...
You can use the following JavaScript to display the event's output in the browser's console:
Code Block |
---|
|
document.addEventListener('mopinion_redirect', function(e) {
console.log(e.detail)
}); |
Specific code to push the Event Object into the Google Tag Manager dataLayer:
Code Block |
---|
|
<script type="text/javascript">
document.addEventListener('mopinion_redirect', function(e) {
dataLayer.push(e.detail)
});
</script> |
The result in the console / dataLayer:
Code Block |
---|
|
{event: "redirect",
key: "[UNIQUE_FORM_KEY]",
formName: "[FORM_NAME]",
url: "[URL_TO_WHICH_IS_BEING_REDIRECTED]"} |
...