Integrating the Plugin
    • 2 Minutes to read
    • Dark
      Light

    Integrating the Plugin

    • Dark
      Light

    Article summary

    For the Mapp Intelligence cookie ID disclosure plugin to work correctly, the corresponding pages must be pixelated.

    Furthermore, the plugin does not have to be executed until a pixel instance exists or a request has been sent.

    <script type="text/javascript" src="webtrekk_v4.min.js"></script>
    <script type="text/javascript">
        // The content of your Mapp Intelligence tracking is placed here
    </script>
    
    <script type="text/javascript" src="pixel-gdpr.min.js"></script>
    <script type="text/javascript">
        // The content of your "CookieID Disclosure Plugin" is placed here
    </script>

    The following code block illustrates a sample integration of the Cookie ID Disclosure plugin.

    <html> 
      <head>
        <title>GDPR example page</title>
        <script type="text/javascript" src="js/webtrekk_v4.min.js"></script> 
        <script type="text/javascript">
            var wt = new webtrekkV3(); 
            wt.contentId = 'en.data privacy.gdpr'; 
            wt.sendinfo();
        </script>
        
        <script type="text/javascript" src="pixel-gdpr.min.js"></script> 
        <script type="text/javascript">
            var readWebtrekkEIDs = function() {
                _getWebtrekkEIDs(function(infoCode, data) {
                  if (infoCode === 1) {
                    // do nothing, because the plugin is collecting the Webtrekk data
                  }
                  else if (infoCode === 2) {
                    alert('Webtrekk tracking isn\'t integrated or was blocked!'); 
                  }
                  else {
                    // is relevant for customers with 3rd party cookies 
                    if (infoCode === 3) {
                        // server timeout (5000ms) for account xxx
                  }
                  else if (infoCode === 4) {
                        // server error for account xxx
                  }
                  else if (infoCode === 5) {
                        // eid not found for account xxx
                  }
    
                  var collectedEIDs = '';
                  for (var trackId in data) {
                      if (data[trackId]) {
                          collectedEIDs += trackId + ': ' + data[trackId] + '\n';
                      } 
                  }
                  
                  if (collectedEIDs) { 
                      alert(collectedEIDs);
                  } 
                }
            }); 
        };
        </script> 
      </head>
      <body>
        <a href="#" onclick="readWebtrekkEIDs()">click here to read Webtrekk EIDs</a>
      </body> 
    </html>
    


    Was this article helpful?

    What's Next