Skip to content

Commit 39b140b

Browse files
authored
Add support for Google Analytics
1 parent 92e70ee commit 39b140b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ comments: true
114114
---
115115
```
116116

117+
### Google Analytics
118+
119+
Tale supports Google Analytics integration using Hugo's provided `google_analytics_async` template.
120+
121+
To enable it, add the `googleAnalytics` tag to your `config.toml`. It will be added on all pages.
122+
123+
```toml
124+
googleAnalytics = "UA-133700000-0"
125+
```
126+
117127
### Custom summaries
118128

119129
Tale allows for writing the summary of your posts manually by setting the `summary` variable in the page frontmatter. If this variable is not set, the summary that Hugo automatically generates will be used.

layouts/partials/head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<head>
2+
<!-- Google Analytics -->
3+
{{ template "_internal/google_analytics_async.html" . }}
24
<meta charset="UTF-8">
35
<meta name="viewport" content="width=device-width, initial-scale=1.0">
46
{{- if .IsHome }}

0 commit comments

Comments
 (0)