Skip to content

Commit

Permalink
add: GA4 for analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed May 17, 2023
1 parent 361a9f2 commit b35696a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 1 addition & 3 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ languageCode = 'fa-IR'
title = 'زبان گو فارسی'
theme = 'hugo-book'

# (Optional) Set Google Analytics if you use it to track your website.
# Always put it on the top of the configuration file, otherwise it won't work
googleAnalytics = "UA-235734076-1"


enableRobotsTXT = true

Expand Down
14 changes: 13 additions & 1 deletion layouts/partials/docs/inject/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css" crossorigin="anonymous">
<link rel="alternate" type="application/rss+xml" href="{{.Site.BaseURL }}/feed.xml" title="{{ .Site.Title }}">

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-235734076-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-235734076-1');
</script>


<script>
var html = document.documentElement;
//Check Storage. Keep user preference on page reload
Expand All @@ -13,4 +24,5 @@
if (localStorage.getItem('themeMode') == 'light') {
html.setAttribute("data-theme","light");
}
</script>
</script>

0 comments on commit b35696a

Please sign in to comment.