Skip to content

Instantly share code, notes, and snippets.

@imgiseverything
Created August 28, 2015 13:19
Show Gist options
  • Save imgiseverything/c218dee2783c013ea7aa to your computer and use it in GitHub Desktop.
Save imgiseverything/c218dee2783c013ea7aa to your computer and use it in GitHub Desktop.
the HTML
<head>
<script type="text/javascript">
var MTUserId='xyz'; // made xyz instead of actual string
var MTFontIds = new Array();
MTFontIds.push("abc"); // made abc instead of id of the fonts
MTFontIds.push("def"); // made def instead of id of the fonts
(function() {
var mtTracking = document.createElement('script');
mtTracking.type='text/javascript';
mtTracking.async='true';
mtTracking.src='mtiFontTrackingCode.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(mtTracking);
})();
</script>
</head>
// Contents of the JavaScript file reference above: mtiFontTrackingCode.js (beautified)
var projectId = window.MTIProjectId;
var mtiTracking = document.createElement('link');
mtiTracking.type = 'text/css';
mtiTracking.rel = 'stylesheet';
mtiTracking.href = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//fast.fonts.net/t/1.css?apiType=css&projectid=' + projectId;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(mtiTracking);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment