diff options
author | Darrel Herbst <dherbst@gmail.com> | 2016-02-06 10:09:47 -0500 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2016-02-13 11:41:21 +0100 |
commit | 06e90b1237cc29fa17be96d13bf9d0428e65e2a8 (patch) | |
tree | eb3cabd0342749d40cd7b89c366c6db6c9753581 /docs | |
parent | a0eec02bd60d1c221b5fc0875761508eb03dd566 (diff) |
Add documentation for Google Analytics internal template
Fixes #1654
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/extras/aliases.md | 2 | ||||
-rw-r--r-- | docs/content/extras/analytics.md | 29 | ||||
-rw-r--r-- | docs/content/extras/builders.md | 2 | ||||
-rw-r--r-- | docs/content/overview/configuration.md | 2 |
4 files changed, 33 insertions, 2 deletions
diff --git a/docs/content/extras/aliases.md b/docs/content/extras/aliases.md index 59c51dc94..9fd252cbe 100644 --- a/docs/content/extras/aliases.md +++ b/docs/content/extras/aliases.md @@ -8,7 +8,7 @@ date: 2013-07-09 menu: main: parent: extras -next: /extras/builders +next: /extras/analytics prev: /taxonomies/ordering title: Aliases weight: 10 diff --git a/docs/content/extras/analytics.md b/docs/content/extras/analytics.md new file mode 100644 index 000000000..112671df5 --- /dev/null +++ b/docs/content/extras/analytics.md @@ -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" . }} diff --git a/docs/content/extras/builders.md b/docs/content/extras/builders.md index 50508b329..1e5fcabb7 100644 --- a/docs/content/extras/builders.md +++ b/docs/content/extras/builders.md @@ -6,7 +6,7 @@ menu: main: parent: extras next: /extras/comments -prev: /extras/aliases +prev: /extras/analytics title: Hugo Builders weight: 20 --- diff --git a/docs/content/overview/configuration.md b/docs/content/overview/configuration.md index 1bd742f36..18f4b14bd 100644 --- a/docs/content/overview/configuration.md +++ b/docs/content/overview/configuration.md @@ -101,6 +101,8 @@ Following is a list of Hugo-defined variables that you can configure and their c editor: "" footnoteAnchorPrefix: "" footnoteReturnLinkContents: "" + # google analytics tracking id + googleAnalytics: "" languageCode: "" layoutdir: "layouts" # Enable Logging |