Private
Public Access
1
0

added Google Analytics

This commit is contained in:
Sander Roosendaal
2017-03-28 07:53:46 +02:00
parent d8c5454ac4
commit a13bed1205
5 changed files with 44 additions and 3 deletions

View File

@@ -5,6 +5,9 @@
<head>
<script src="/static/cookielaw/js/cookielaw.js"></script>
{% analytical_head_top %}
{% if GOOGLE_ANALYTICS_PROPERTY_ID %}
{% include "ga.html" %}
{% endif %}
<link rel="stylesheet" href="/static/css/bokeh-0.12.3.min.css" type="text/css" />
<link rel="stylesheet" href="/static/css/bokeh-widgets-0.12.3.min.css" type="text/css" />
@@ -52,7 +55,7 @@
{% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %}
<h6>Pro Member</h6>
{% else %}
<p>&nbsp;</p>
<div class="grid_2 alpha"><a class="button green small" href="/rowers/promembership">Upgrade to Pro</a></div>
{% endif %}
</div>
<div class="grid_1 omega">

10
rowers/templates/ga.html Normal file
View File

@@ -0,0 +1,10 @@
<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', '{{ GOOGLE_ANALYTICS_PROPERTY_ID }}', '{{ GOOGLE_ANALYTICS_DOMAIN }}');
ga('send', 'pageview');
</script>

View File

@@ -561,7 +561,10 @@ class ViewTest(TestCase):
response = self.c.get('/rowers/workout/1/', form_data, follow=True)
self.assertEqual(response.status_code, 200)
response = self.c.get('/rowers/workout/1/export', form_data, follow=True)
self.assertEqual(response.status_code, 200)
response = self.c.get('/rowers/workout/1/interactiveplot', form_data, follow=True)
self.assertEqual(response.status_code, 200)