mirror of
https://github.com/thangisme/notes.git
synced 2025-01-09 12:36:39 -05:00
Replaced old script for analytics with gtag
This commit is contained in:
parent
721484a26e
commit
2d1babc452
@ -2,6 +2,17 @@
|
||||
<meta charset="UTF-8">
|
||||
<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 %}
|
||||
<title>{{ page.title }} - {{ site.title }}</title>
|
||||
|
||||
@ -14,15 +25,6 @@
|
||||
|
||||
<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 %}
|
||||
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user