Many third-party website tracking tools and widgets (e.g. Google Analytics, Piwik) require you to copy-and-paste Javascript code into the bottom of your site, right before the closing body tag.
If your website is Django based, what's the standard way of adding this type of code to to the site?
Do you:
- paste it directly into base.html
- create a {% block extra_js %}{% endblock %} right before the closing body tag in base.html and stick it in there and/or another template
- create a new Django app (assuming there's no existing one yet or none that meets your needs)
- or do something else?
And if you're a consultant dealing with inexperienced clients and you do option 3, do you advise your clients to take the same approach when they're adding to the project code themselves?