Skip to content

Commit

Permalink
Add Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo-Colizzi committed Jan 12, 2024
1 parent 5c245dc commit 4c43926
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,6 @@ jekyll-archives:
permalinks:
tag: /tags/:name/
category: /categories/:name/


google_analytics: G-MF6Q7GFR7Y
14 changes: 14 additions & 0 deletions _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
The GA snippet
-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

gtag('js', new Date());
gtag('config', '{{ site.google_analytics.id }}');
});
</script>

0 comments on commit 4c43926

Please sign in to comment.