1
0
mirror of https://github.com/ipdb/website.git synced 2024-11-23 01:50:02 +01:00
website/_src/_includes/scripts.html

68 lines
1.8 KiB
HTML
Raw Normal View History

2017-08-09 17:12:21 +02:00
<!--
//
// Site scripts
//
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
2017-08-09 17:12:21 +02:00
<script src="/assets/js/ipdb.min.js"></script>
{% if page.js %}
2017-10-30 09:36:30 +01:00
<script src="/assets/js/{{ page.js }}.min.js"></script>
2017-08-09 17:12:21 +02:00
{% elsif layout.js %}
2017-10-30 09:36:30 +01:00
<script src="/assets/js/{{ layout.js }}.min.js"></script>
2017-08-09 17:12:21 +02:00
{% endif %}
<!--
//
// Google Analytics
//
-->
<script>
if (!_dntEnabled()) {
(function(window) {
// Google Analytics async snippet
// http://goo.gl/3FPNDx
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};
ga.l=+new Date;
// Create the GA tracker
ga('create', '{{ site.analyticsID }}', 'auto', {siteSpeedSampleRate: 10});
{% if jekyll.environment != 'production' %}
// In non-production mode, simply log GA hits to the console.
// Note, tasks must be set before sending the first hit
ga(function(tracker) {
tracker.set('sendHitTask', function() {
// Throw to stop subsequent tasks.
throw 'Abort tracking in non-production environments.'
});
});
{% endif %}
// Send initial pageview
ga('send', 'pageview');
// Track uncaught errors
window.onerror = function(message, url, line, col) {
var desc = message + ' (line: ' + line + ', url: ' + url + ', col: '
+ col + ')';
ga('send', 'exception', {
exDescription: 'window.onerror: ' + desc,
exFatal: false
});
};
}(window));
}
</script>
{% if jekyll.environment == "production" %}
<script async src="//www.google-analytics.com/analytics.js"></script>
{% else %}
<script async src="//www.google-analytics.com/analytics_debug.js"></script>
{% endif%}