I've just discovered an easy way to add custom content to .rst files. All you need to do it to modify the template for html files.
Make a new template template.txt and the following contents to it (based on the default template):
%(head_prefix)s
%(head)s
<!--your tracking code-->
%(stylesheet)s
%(body_prefix)s
%(body_pre_docinfo)s
%(docinfo)s
%(body)s
%(body_suffix)s
The format is pretty self explanatory and its also a good way to remove the default CSS and specify a link to another one in the template etc.
Now you can use your custom template with the rst2html writer:
rst2html.py --template=template.txt document.rst