diff --git a/docs/source/_assets/js/nav.js b/docs/source/_assets/js/nav.js index 0f58a238b..bfb5a4617 100644 --- a/docs/source/_assets/js/nav.js +++ b/docs/source/_assets/js/nav.js @@ -52,8 +52,10 @@ $.when($.ready).then(function() { }, '', href) // Track on Google Analytics - ga('set', 'page', href) - ga('send', 'pageview') + if (typeof(ga) === 'function') { + ga('set', 'page', href) + ga('send', 'pageview') + } }) }) @@ -66,8 +68,10 @@ $.when($.ready).then(function() { $('#content').html(e.state.content) // Track on Google Analytics - ga('set', 'page', e.state.href) - ga('send', 'pageview') + if (typeof(ga) === 'function') { + ga('set', 'page', e.state.href) + ga('send', 'pageview') + } } }