mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
committed by
digitalcraftsman
parent
a0eec02bd6
commit
06e90b1237
@@ -8,7 +8,7 @@ date: 2013-07-09
|
|||||||
menu:
|
menu:
|
||||||
main:
|
main:
|
||||||
parent: extras
|
parent: extras
|
||||||
next: /extras/builders
|
next: /extras/analytics
|
||||||
prev: /taxonomies/ordering
|
prev: /taxonomies/ordering
|
||||||
title: Aliases
|
title: Aliases
|
||||||
weight: 10
|
weight: 10
|
||||||
|
29
docs/content/extras/analytics.md
Normal file
29
docs/content/extras/analytics.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
date: 2016-02-06
|
||||||
|
linktitle: Analytics
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
parent: extras
|
||||||
|
next: /extras/builders
|
||||||
|
prev: /extras/aliases
|
||||||
|
title: Analytics in Hugo
|
||||||
|
weight: 15
|
||||||
|
---
|
||||||
|
|
||||||
|
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" . }}
|
@@ -6,7 +6,7 @@ menu:
|
|||||||
main:
|
main:
|
||||||
parent: extras
|
parent: extras
|
||||||
next: /extras/comments
|
next: /extras/comments
|
||||||
prev: /extras/aliases
|
prev: /extras/analytics
|
||||||
title: Hugo Builders
|
title: Hugo Builders
|
||||||
weight: 20
|
weight: 20
|
||||||
---
|
---
|
||||||
|
@@ -101,6 +101,8 @@ Following is a list of Hugo-defined variables that you can configure and their c
|
|||||||
editor: ""
|
editor: ""
|
||||||
footnoteAnchorPrefix: ""
|
footnoteAnchorPrefix: ""
|
||||||
footnoteReturnLinkContents: ""
|
footnoteReturnLinkContents: ""
|
||||||
|
# google analytics tracking id
|
||||||
|
googleAnalytics: ""
|
||||||
languageCode: ""
|
languageCode: ""
|
||||||
layoutdir: "layouts"
|
layoutdir: "layouts"
|
||||||
# Enable Logging
|
# Enable Logging
|
||||||
|
Reference in New Issue
Block a user