|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html lang="{{ site.lang | default: "en-US" }}">
|
3 | 3 | <head>
|
4 |
| - <meta charset="UTF-8"> |
| 4 | + {% if site.google_analytics %} |
| 5 | + <!-- Global Site Tag (gtag.js) - Google Analytics --> |
| 6 | + <script async src="https://www.googletagmanager.com/gtag/js?id=UA-107694606-1"></script> |
| 7 | + <script> |
| 8 | + window.dataLayer = window.dataLayer || []; |
| 9 | + function gtag(){dataLayer.push(arguments);} |
| 10 | + gtag('js', new Date()); |
| 11 | + |
| 12 | + gtag('config', 'UA-107694606-1'); |
| 13 | + </script> |
| 14 | + {% endif %} <meta charset="UTF-8"> |
5 | 15 |
|
6 | 16 | {% seo %}
|
7 | 17 | <meta name="description" content="{{ page.description | default: site.description | default: site.github.project_tagline }}"/>
|
@@ -35,16 +45,6 @@ <h2 class="project-tagline">{{ site.description | default: site.github.project_t
|
35 | 45 | </footer>
|
36 | 46 | </section>
|
37 | 47 |
|
38 |
| - {% if site.google_analytics %} |
39 |
| - <script type="text/javascript"> |
40 |
| - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
41 |
| - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
42 |
| - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
43 |
| - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
44 | 48 |
|
45 |
| - ga('create', '{{ site.google_analytics }}', 'auto'); |
46 |
| - ga('send', 'pageview'); |
47 |
| - </script> |
48 |
| - {% endif %} |
49 | 49 | </body>
|
50 | 50 | </html>
|
0 commit comments