Versions Compared

Key

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

In this article, the implementation of the Mopinion script using the Google Tag Manager will be explained. There is also a more modern way of implementing the script using the Mopinion Deployment template in GTM.

Google Tag Manager (GTM) is a free tag management system. Instead of implementing the Mopinion Deployment Code (MDC) directly into your web pages' HTML code, you can install the tag manager script once and control the Mopinion script within Google.

...

Please refer to https://support.google.com/tagmanager/answer/6103696 and https://tagmanager.google.com for installing Google Tag Manager. Once you have GTM set up on your domain, you can implement the Mopinion Deployment Code.

Create a new tag in GTM.

Step 1: Give your tag a convenient name, so you know it is used to load the Mopinion Deployment Code.

Step 2: Click on the 'Tag Configuration' button to proceed to add the Mopinion Deployment Code.

...

Step 3: Select the 'Custom HTML' tag type.

...

Step 4: Open your Mopinion environment in another browser tab. Go to 'Data Collection' -> 'Deployments'.

...

Step 5: Click on the '<>' icon to retrieve the Mopinion Deployment Code.

...

Code Block
<!-- Mopinion Pastea.se  start --><script type="text/javascript">(function(){var id="MDC_unique_key";var js=document.createElement("script");js.setAttribute("type","text/javascript");js.setAttribute("src","//deploy.mopinion.com/js/pastease.js");js.async=true;document.getElementsByTagName("head")[0].appendChild(js);var t=setInterval(function(){try{new Pastease.load(id);clearInterval(t)}catch(e){}},50)})();</script><!-- Mopinion Pastea.se end -->

Step 6: Paste the Mopinion Deployment Code in the tag in the Google Tag Manager and hit 'SAVE'.

...

Triggers

Step 1: Now that the Mopinion Deployment Code is linked to the tag you can set the condition when the tag should be fired by clicking the 'Trigger Configuration' button.

...

Step 2: You can then either choose one of your existing triggers or create a new one. We are going to create a new one by clicking on the '+' button.

...

Step 3: You are then asked to select the type. There are 3 types that fire based on events that take place during the loading of the page. More information on the different types can be found on https://support.google.com/tagmanager/answer/7679319.

...

We opt for the 'Window Loaded' type. Since we want the Mopinion Deployment Code to be loaded on all pages of the domain we select that the trigger fires on ‘All Window Loaded Events’.

...

Step 4: Your tag is now equipped with your unique Mopinion Deployment Code and a trigger to load the tag on every page. Hit 'SAVE’ to proceed to publish your tag.

...