Skip to content

Commit

Permalink
update analytics script in docs template
Browse files Browse the repository at this point in the history
  • Loading branch information
danswick authored and 1ec5 committed Feb 6, 2020
1 parent 17cdc9e commit be90d21
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions docs/theme/templates/doc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,10 @@
}
</style>
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
analytics.load("fl0c8p240n");
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
var resp = JSON.parse(xhttp.responseText);
analytics.identify(resp.id, {email: resp.email}, {}, function() {
analytics.page();
});
} else {
analytics.page();
}
}
xhttp.open("GET", "https://www.mapbox.com/api/session", true);
xhttp.send();
}}();
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error('Segment snippet included twice.');else{analytics.invoked=!0;analytics.methods=['trackSubmit','trackClick','trackLink','trackForm','pageview','identify','reset','group','track','ready','alias','debug','page','once','off','on'];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t,e){var n=document.createElement('script');n.type='text/javascript';n.async=!0;n.src=('https:'===document.location.protocol?'https://':'http://')+'cdn.segment.com/analytics.js/v1/'+t+'/analytics.min.js';var o=document.getElementsByTagName('script')[0];o.parentNode.insertBefore(n,o);analytics._loadOptions=e;};analytics.SNIPPET_VERSION='4.1.0';
analytics.load('fl0c8p240n',{integrations: {All: false,'Google Analytics': true,'Segment.io': true, 'Facebook Pixel': true}});
analytics.page();
}}();
</script>
</head>
<body>
Expand Down

0 comments on commit be90d21

Please sign in to comment.