Skip to content

Commit d3112bc

Browse files
Add Google Analytics
1 parent 2de19bb commit d3112bc

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

conf.ini

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ OutputPath: ./output
55
RootURL: ./
66
Repository: https://github.com/UMBC-Linux-Users-Group/lug.umbc.edu
77
RepositoryVersion: ${main:Repository}/tree/${autogen:FullVersion}
8+
GA_ID: UA-60486500-1
89

910
[pages]
1011
Home Page:

generate.py

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
links = cp['links'],
6262
repository = conf.get('Repository'),
6363
versionlink = conf.get('RepositoryVersion'),
64+
GA_ID = conf.get('GA_ID'),
6465
versionsum = cp['autogen'].get('VersionSummary'),
6566
lastchanged = cp['autogen'].get('LastChanged'),
6667
data = data,

templates/base.html

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@
1212
<meta name="robots" content="index,follow">
1313
<meta name="MSSmartTagsPreventParsing" content="true">
1414

15+
{% block analytics %}
16+
<script>
17+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
18+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
19+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
20+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
21+
22+
ga('create', '{{ GA_ID }}', 'auto');
23+
ga('send', 'pageview');
24+
</script>
25+
{% endblock %}
26+
1527
{% block head %}
1628
{% endblock %}
1729

0 commit comments

Comments
 (0)