Closed nathan-osman closed 10 years ago
I use something like this for my Jekyll blog -> https://github.com/nitstorm/motoko/blob/master/_layouts/default.html storing the value of the tracking code identifier alone from the user in a variable.
Take a look at the end of the page, would that work?
But, we are talking about not hardcoding it into templates, so how about something like if google analytics variable is set, then include google-analytics-snippet.html or something like that?
Well, with Django it's easiest to add this setting to local_settings.py and the just use {% if %} ... {% endif %} in base.html.
:+1:
I changed my mind. :smile: I am going to hardcode the Google Analytics tracking script for two reasons:
There is currently no way to specify the Google Analytics code, which is needed for integrating with... Google Analytics. This should not be hardcoded into the templates.