Global footer

Usage

Script Mars Cookie bar:
html
            <script src="https://footer.mars.com/js/footer.js.aspx?royalcanin-fi"></script>
Script Mars Cookie bar:
<script type="text/javascript">
  (function (id) {
    function append(scriptid, url, async) {
      var d = document, sn = 'script', f = d.getElementsByTagName(sn)[0];
      if (!f) {
        f = d.head;
      }
      var s = d.createElement(sn);
      s.async = true;
      s.id = scriptid;
      s.src = url;
      f.parentNode.insertBefore(s, f);
    }

    function getRootDomain() {
      var parts = window.location.hostname.split('.');
      if (parts.length === 2) {
        rootDomain = parts[0];
      }
      else if (parts.length > 2) {
        // see if the next to last value is a common tld
        var part = parts[parts.length - 2];
        if (part === 'com' || part === 'co') {
          rootDomain = parts[parts.length - 3]; // go back one more
        }
        else {
          rootDomain = part;
        }
      }

      return rootDomain;
    }

    window.evidon = {};
    window.evidon.id = id;
    var cdn = '//c.evidon.com/', rootDomain = getRootDomain(), noticecdn = cdn + 'sitenotice/';
    append('evidon-notice', noticecdn + 'evidon-sitenotice-tag.js', false);
    append('evidon-location', cdn + 'geo/country.js', true);
    append('evidon-themes', noticecdn + id + '/snthemes.js', true);
    if (rootDomain) {
      append('evidon-settings', noticecdn + id + '/' + rootDomain + '/settings.js', true);
    }

    window.evidon.priorConsentCallback = function () {
      // add the tags which need to wait for prior consent
      // here. This should be all your advertising tags and
      // probably most of your social and tracking tags.
    }
  })(1678);
</script>
        

Issues

If you are having problems implementing this code, please submit an issue on our Github page.

Github Octocat

Feedback

If you would like to offer feedback on the design of this component, please send an email requesting access to the Design Language Slack channel.

Slack logo