Table of Contents

Self-Hosting CaliberMind AnalyticsJS

Nic Zangre Updated by Nic Zangre

Why Self-Host?

As web browsers continue to implement additional privacy measures and ad blockers, self-hosting provides the best shot at maximum track-ability of your visitors. Self hosting allows all site on your site to be hosted on your site.

CaliberMind uses a first party cookie originating from <yourcompany>.com, this article will help you host our JavaScript Analytics Library on <yourcompany>.com to help maximize your tracking footprint.

Benefits of Self-Hosting

The Main benefits of self-hosting the file (client-hosted CDN) are:

  • Better data collection rates; self-hosting = 1st party tag loading, which prevents ad-blockers from disrupting the client's data collection.
  • Better tag performance and faster tag loading.
  • Ability to control updates to the file for security review.
  • MetaRouter's identity syncing function (Sync Injector) loads IDs into a 1st-party cookie.

Requirements to Self-Host

  • A branded Content Delivery Network (CDN), such as cdn.<yourcompany>.com
  • A process and IT administrator to refresh the JavaScript file once at least every 2 months.

  1. How to retrieve your API Write Key
    1. As a CaliberMind admin access the Web Tracker page via your Organization's settings.
    2. In the code snippet provided, locate your Analytics write key. The key can can be found in your snippet in this code block:
    (see example below)
    Installing CaliberMind tracking code on your website
  2. Accessing and downloading Page JavaScript file
    1. Each generated Analytics.js file can be found on Metarouter's CDN with the following convention:<metarouter key>.js , where<WRITE_KEY>is the pipeline id/write key described as the source within you CaliberMind header snippet.
    2. Download this file and upload it to the secondary location of your choice.
  3. Update the JavaScript SDK header & footer snippet with the new domain

Manually modify the larger snippet, described above in Step 1. documentation, to replace this string with the correct location pointing to the file. Expect the file to still have its original name.

  • That step should be performed quarterly (at a minimum) to ensure the file that has any security updates MetaRouter may push.

In the <head> on your site, make sure every page is updated with the new code block.


If you are using CaliberMind's "Auto-Identify" script in your site's <footer> such as the below, you'll also want to host this file and re-point your code to your CDN file:

type="text/javascript" src=""></script>


  • Self-hosted files do not automatically receive updates or bug fixes when deployed.
  • CaliberMind and Metarouter are no longer are responsible for page-load times of the Analytics.js hosted on your CDN.

How did we do?

Attribution Models: First-Touch