Skip to content

Commit

Permalink
docs: change GA code position
Browse files Browse the repository at this point in the history
  • Loading branch information
streamtw committed Nov 20, 2023
1 parent bd84899 commit 6b08141
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
{% if site.google_analytics %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
<meta charset="UTF-8">
<title>{{ page.title | default: site.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down Expand Up @@ -125,16 +135,5 @@ <h2 class="project-tagline">{{ site.description | default: site.github.project_t
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</section>

{% if site.google_analytics %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.google_analytics }}');
</script>
{% endif %}
</body>
</html>

0 comments on commit 6b08141

Please sign in to comment.