Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can use the following JavaScript to display the event's output in the browser's console:

Code Block
languagejs
document.addEventListener('mopinion_ready', function(e) {
console.log(e.detail)
});

Specific code to push the Event Object into the Google Tag Manager dataLayer:

Code Block
languagejs
<script type="text/javascript">
document.addEventListener('mopinion_ready', function(e) {
  dataLayer.push(e.detail)
});
</script>

The result in the console / dataLayer:

Code Block
languagejson
{event: "ready",
key: "[UNIQUE_FORM_KEY]",
formName: "[FORM_NAME]"}

...

You can use the following JavaScript to display the event's output in the browser's console:

Code Block
languagejs
document.addEventListener('mopinion_will_show', function(e) {
console.log(e.detail)
});

Specific code to push the Event Object into the Google Tag Manager dataLayer:

Code Block
languagejs
<script type="text/javascript">
document.addEventListener('mopinion_will_show', function(e) {
dataLayer.push(e.detail)
});
</script>

The result in the console / dataLayer:

Code Block
languagejson
{event: "will_show", 
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
languagejs
document.addEventListener('mopinion_shown', function(e) {
console.log(e.detail)
});

Specific code to push the Event Object into the Google Tag Manager dataLayer:

Code Block
languagejs
<script type="text/javascript">
document.addEventListener('mopinion_shown', function(e) {
dataLayer.push(e.detail)
});
</script>

The result in the console / dataLayer:

Code Block
languagejson
{event: "shown", 
key: "[UNIQUE_FORM_KEY]",
formName: "[FORM_NAME]", 
triggerMethod: "[PASSIVE | PROACTIVE | EXIT]"}

...