Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Include Google Analytics code and instructions

  • Loading branch information...
mbland committed Apr 28, 2015
1 parent 159c8c5 commit 80f273707625a99eab4c35dfa4bf2d54389e5ab4
Showing with 28 additions and 0 deletions.
  1. +2 −0 _config.yml
  2. +16 −0 _includes/analytics.html
  3. +1 −0 _layouts/default.html
  4. +9 −0 pages/config.md
@@ -49,3 +49,5 @@ repos:

# Style Variables
brand_color: "#1188ff"

google_analytics_ua: UA-48605964-19
@@ -0,0 +1,16 @@
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics_ua }}', 'gsa.gov');
// anonymize user IPs (chops off the last IP triplet)
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>

<!-- Digital Analytics Program roll-up, see https://analytics.usa.gov for data -->
<script id="_fed_an_ua_tag" src="https://analytics.usa.gov/dap/dap.min.js" async></script>
@@ -33,6 +33,7 @@ <h1>{{ page.title }}</h1>

</div> <!-- /.container -->

{% include analytics.html %}
{% include scripts.html %}

</body>
@@ -7,6 +7,7 @@ title: Updating the Config File
- [Copy the `exclude:` entries](#copy-exclude-entries)
- [Register new pages](#register-new-pages)
- [Update the repository list](#update-repository-list)
- [Set `google_analytics_ua`](#set-google-analytics)

Once you're finished updating the config file, click the _GitHub Setup_
entry in the table of contents.
@@ -72,3 +73,11 @@ repos:{% for i in site.repos %}
url: {{ i.url }}
{% endfor %}
```
## <a name="set-google-analytics"></a>Set `google_analytics_ua`
Set `google_analytics_ua` to the following, if it isn't set already:
```yaml
google_analytics_ua: {{ site.google_analytics_ua }}
```

0 comments on commit 80f2737

Please sign in to comment.
You can’t perform that action at this time.