Skip to content

Commit

Permalink
ga test
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneTC committed Sep 23, 2024
1 parent 200ccca commit af4a1e5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ sass:

plugins:
- jekyll-sitemap
- jekyll-seo-tag

google_analytics: G-XYF4CL5HT2
paginate: 7
Expand Down
8 changes: 8 additions & 0 deletions docs/_includes/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<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>
6 changes: 6 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
{{ site.data.settings.advanced_settings.header_js }}
{% endif %}


<!-- GA TRACKING -->
{% if site.google_analytics and jekyll.environment != 'dev' %}
{% include analytics.html %}
{% endif %}

</head>


Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# How to build website
- Navigate to `/docs`
- exec `bundle exec jekyll serve`
- exec `JEKYLL_ENV=dev bundle exec jekyll serve`

0 comments on commit af4a1e5

Please sign in to comment.