Skip to content

Commit

Permalink
Update default.html
Browse files Browse the repository at this point in the history
Update Google Analytics to GA4
  • Loading branch information
cannin authored Jun 30, 2024
1 parent 91f4f4f commit cd9d626
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@
</div>
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
{% if site.google_analytics %}
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3FKNF0XRRG"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-3FKNF0XRRG');
</script>
{% endif %}
</body>
Expand Down

0 comments on commit cd9d626

Please sign in to comment.