Reputation: 1590
My project documentation is hosted on readthedocs.org at
http://nsetools.readthedocs.org
Is it possible to use google analytics with documents hosted on readthedocs? Since html is not generated by me, I am not sure where to apply the google analytics code snippet.
Upvotes: 3
Views: 975
Reputation: 456
Put googlea<id>.html
(from Google Search Console) into docs/source
and add
html_extra_path = ["googlea<id>.html"]
somewhere in conf.py
, then verify using Google Search Console.
googlea<id>.html
file and place it in docs/source
(e.g. mat_discover/docs/source
). Use html_extra_path
inside of conf.py
as follows (i.e. add the following line somewhere in conf.py
):html_extra_path = ["googlea<id>.html"]
docs
folder, run:make clean
make html
and check to make sure docs/build/html/googlea<id>.html
exists.
Note: Everywhere mentioned, replace "<id>" with the actual ID that is shown from step 1, and "<my-website>>" with the name of your RTD site.
Upvotes: 1
Reputation: 393
I haven't tried this myself but see http://www.drmaciver.com/2015/04/getting-google-analytics-on-readthedocs/
Go to the Admin page for your project, Click on “Advanced settings”, Enter your Google Analytics Tracking ID in the box at the bottom that says 'Analytics ID'
Upvotes: 1