Skip to content

Commit

Permalink
feat: adds google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
migtarx committed Dec 8, 2023
1 parent 6a107eb commit 788c226
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ languageCode = "en-us"
theme = "hello-friend"
paginate = 5
publishDir = "src/public"
googleAnalytics = "G-XLN4KF6SDM"

[params]
contentTypeName = "posts"
Expand Down
9 changes: 9 additions & 0 deletions themes/hello-friend/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XLN4KF6SDM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-XLN4KF6SDM');
</script>
<meta name="version" content="1.0.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down

0 comments on commit 788c226

Please sign in to comment.