mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-03 20:22:38 +00:00
dd78d5b23f
git-subtree-dir: docs
git-subtree-split: 5d9a670359
652 B
652 B
date, linktitle, menu, next, prev, title
| date | linktitle | menu | next | prev | title | ||||
|---|---|---|---|---|---|---|---|---|---|
| 2016-02-06 | Analytics |
|
/extras/builders | /extras/aliases | Analytics in Hugo |
Hugo ships with prebuilt internal templates for Google Analytics tracking, including both synchronous and asynchronous tracking codes.
Configuring Google Analytics
Provide your tracking id in your configuration file, e.g. config.yaml.
googleAnalytics = "UA-123-45"
Example
Include the internal template in your templates like so:
{{ template "_internal/google_analytics.html" . }}
For async include the async template:
{{ template "_internal/google_analytics_async.html" . }}