Skip to content

How to add Google Analytics?

Geoffroy Noël edited this page May 8, 2019 · 4 revisions

You don't need to modify any template or Django code.

You can either locate the following line and set Google Analytics ID in settings/base.py then commit and push to github.

# Google Analytics ID
GA_ID = ''

Or, better still, add/replace this line in settings/local.py on the live website instance (requires ssh access to the live server, so probably best done by software developer):

# Google Analytics ID
GA_ID = ''

If you do that please also document the ID in a note on active collab.

In both cases:

Make sure you test the request to Google from the live home page. Open your browser debugging tools and looks at the network tab, you should see a request to Google analytics.