Skip to content
Snippets Groups Projects
Commit 2d1babc4 authored by hallowf's avatar hallowf
Browse files

Replaced old script for analytics with gtag

parent 721484a2
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
{% if site.ga_tracking != nil %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga_tracking }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.ga_tracking }}');
</script>
{% endif %}
{% if site.plugins.jekyll-seo == nil %} {% if site.plugins.jekyll-seo == nil %}
<title>{{ page.title }} - {{ site.title }}</title> <title>{{ page.title }} - {{ site.title }}</title>
...@@ -14,15 +25,6 @@ ...@@ -14,15 +25,6 @@
<link rel="stylesheet" href="{{ "/assets/css/just-the-docs.css" | absolute_url }}"> <link rel="stylesheet" href="{{ "/assets/css/just-the-docs.css" | absolute_url }}">
{% if site.ga_tracking != nil %}
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ site.ga_tracking }}', '{{ site.url }}');
ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
{% endif %}
{% if site.search_enabled != nil %} {% if site.search_enabled != nil %}
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script> <script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
{% endif %} {% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment