Skip to end of banner
Go to start of banner

How do I implement the Mopinion script?

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

To run Mopinion feedback forms on your website you will have to implement a JavaScript-tag on your website. This article explains how to implement the JavaScript tag without the use of a tag management tool, such as Google Tag Manager.

Step 1

After saving and publishing the deployment, get the deployment code by clicking the ‘<>' button at the 'DEPLOY’ window.

Step 2

Select the code and copy it or click on the copy code button.

Step 3

Place the code in the HTML of the page source before the </body> tag. Now the feedback button will appear on the website and you can start collecting feedback.

The Mopinion script can be placed on all URLs of a domain or the specific pages on which you want to deploy the Mopinion feedback forms. There are two possibilities to place the script on a webpage.

In the first case, the JavaScript-tag will be directly placed in the HTML of the page source. The Mopinion code needs to be placed just before the closing body tag: </body>.

The other implementation method is done with a tag manager, for instance: Google Tag Manager. The script will then be injected into the generated source code.
Read more about implementing Mopinion with Google Tag Manager here.

Compared to the first implementation option, the second method is less labour intensive. After all, the script requires only one step and it also offers more flexibility. The implementation of (new) forms on (new) URL’s can be set via the tag manager. One condition for this way of implementation is, of course, the availability of a tag manager.

The Mopinion script will function identically, regardless of the way it is implemented.

You can find your Mopinion JavaScript tag under: Data collection / Forms / Deployments.

Form appearance

There are three ways the form can appear on a (mobile) website. The form can be shown in a grey, transparent overlay (in a modal) or as a slide-in or the form can be displayed as part of the content and layout of the web page (which is called an embedded form). Additional implementation operations are not required when the form will be shown in a modal.

If a form is an integral element of the content and layout of the page (embedded), an additional < div > (HTML-element) needs to be implemented as well. The < div > is to be placed directly in the body of the HTML or inserted via the tag manager. It is important that the < div > is placed at the exact location in the HTML (DOM) where the form should appear. The div for the embedded forms is

<div id="surveyContent"></div>

In order to check if the implementation has been done correctly, you can check the version of your Mopinion tag and trigger the form with your browser console. 

If your Mopinion tag contains a file reference named "pastease.js" you can do the following:

  • Open the browser development tools. Hotkey for most browsers is F12.

  • Select the console.

  • On the command line, enter :

    srv.openModal(true,'<FORMKEY>')

    The <FORMKEY> can be found in the URL of the preview page. See How do I open a Mopinion feedback form with my own button or link? for more details on retrieving the <FORMKEY>.

  • An overlay should appear on the webpage.

  • No labels