Merge pull request #162 from nergmada/google-analytics-patch

Modified the google analytics code to match the new tags used by GA
This commit is contained in:
Patrick Marsceill 2019-08-13 11:09:51 -04:00 committed by GitHub
commit efbc5c2a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -15,12 +15,15 @@
<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 %} {% if site.ga_tracking != nil %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{site.ga_tracking}}"></script>
<script> <script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; window.dataLayer = window.dataLayer || [];
ga('create', '{{ site.ga_tracking }}', '{{ site.url }}'); function gtag(){dataLayer.push(arguments);}
ga('send', 'pageview'); gtag('js', new Date());
gtag('config', "{{site.ga_tracking}}");
</script> </script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
{% endif %} {% endif %}
{% if site.search_enabled != nil %} {% if site.search_enabled != nil %}