This extension will not load Google Analytics if the user's browser has Do Not Track enabled. This is by design, since Google Analytics itself does not respect the Do Not Track header. Almost all adblockers & privacy addons will also disable Google Analytics.
If you are providing a hosted service that uses this extension, it is your responsibility to:
- Ensure that your users know they are being tracked
Don't just not be evil, try actively to be Good!
A virtualenv is recommended for using this. Inside a virtualenv, you can install this extension easily!
pip install nbgoogleanalytics jupyter nbextensions install --py --sys-prefix nbgoogleanalytics
You can then enable it with:
jupyter nbextensions enable --py --sys-prefix nbgoogleanalytics jupyter serverextensions enable --sys-prefix nbgoogleanalytics
There's only one configuration parameter, and that's the Google Analytics
Tracking Id. You get it after you set up a Google Analytics property, and
it looks something like
You can easily pass that to the extension by passing it as a commandline parameter.
jupyter notebook --GoogleAnalytics.tracking_id="UA-NNNNN-N"