Getting the tag

Here is the base snippet for the tag:

<script type="text/javascript">
    /* YOU SHOULD NOT EDIT THIS PART */
    !function(a,b,c){"use strict";function d(a){var b=e[c]||{};e[c]=b,b[a]||(b[a]=function(){e._queue[c].push({method:a,args:Array.prototype.slice.apply(arguments)})})}var e=a.scimhtiraidem||{},f="init call config push pushDefault addProperties addProperty onFinish onStart _reset".split(" ");e._queue=e._queue||{},e._names=e._names||[],e._names.push(c),e._queue[c]=e._queue[c]||[],e._startTime=(new Date).getTime(),e._snippetVersion="2.0";for(var g=0;g<f.length;g++)d(f[g]);a.scimhtiraidem=e,a[c]=e[c];var h=b.createElement("script");h.setAttribute("type","text/javascript"),h.setAttribute("src","https://static.mediarithmics.com/tag/1/tag.min.js"),h.setAttribute("async","true"),b.getElementsByTagName("script")[0].parentNode.appendChild(h)}(window,document,"mics");

    mics.init("<SITE_TOKEN>");
</script>

There are a few things we should unpack here.

The line below the "YOU SHOULD NOT EDIT THIS PART" comment is where we load our tag asynchronously. Obviously, you should not edit this part.

For the tag to work correctly, you should replace <SITE_TOKEN> with your own site token. Your site token can be found in the UI:

  • then Datamart > Channels

  • you can see your site token in the "Token" column of the channels list

So if your site token is my-site-token, your tag should look like this:

<script type="text/javascript">
    /* YOU SHOULD NOT EDIT THIS PART */
    !function(a,b,c){"use strict";function d(a){var b=e[c]||{};e[c]=b,b[a]||(b[a]=function(){e._queue[c].push({method:a,args:Array.prototype.slice.apply(arguments)})})}var e=a.scimhtiraidem||{},f="init call config push pushDefault addProperties addProperty onFinish onStart _reset".split(" ");e._queue=e._queue||{},e._names=e._names||[],e._names.push(c),e._queue[c]=e._queue[c]||[],e._startTime=(new Date).getTime(),e._snippetVersion="2.0";for(var g=0;g<f.length;g++)d(f[g]);a.scimhtiraidem=e,a[c]=e[c];var h=b.createElement("script");h.setAttribute("type","text/javascript"),h.setAttribute("src","https://static.mediarithmics.com/tag/1/tag.min.js"),h.setAttribute("async","true"),b.getElementsByTagName("script")[0].parentNode.appendChild(h)}(window,document,"mics");

    mics.init("my-site-token");
</script>

Last updated