Wondering if anyone has seen this.
I've set my tracking id in menu.py
response.google_analytics_id = 'UA-XXXXXXXX-X'
When I load my site, I get js errors:
SyntaxError: syntax error
Line 4
ReferenceError: analytics is not defined
Line 2682
This is what I have in layout.html
{{if response.google_analytics_id:}}
<script src="{{=URL('static','js/analytics.js')}}"></script>
<script type="text/javascript">
analytics.initialize({
'Google Analytics':{trackingId:'{{=response.google_analytics_id}}'}
});</script>
{{pass}}
Using web2py v2.5.1-stable+timestamp.2013.06.06.10.23.23