Add google tag manager tracking#84
Conversation
jacobtomlinson
left a comment
There was a problem hiding this comment.
Thanks @scharlottej13, a few questions.
dask_sphinx_theme/layout.html
Outdated
| @@ -1,5 +1,33 @@ | |||
| {%- set favicon_url = favicon_url or ('_static/' + ('images/favicon.svg')) %} {% | |||
| extends "sphinx_book_theme/layout.html" %} {%- block content %} | |||
| extends "sphinx_book_theme/layout.html" %} {% block extrahead %} | |||
There was a problem hiding this comment.
Would it be possible to add this to the footer instead of the head? Putting it in the head will block the page from loading until the script is done.
There was a problem hiding this comment.
Yup, I can move it down! I was following the GTM instructions, but at least one person on the internet claims moving it down won't affect analytics
dask_sphinx_theme/layout.html
Outdated
| j.async = true; | ||
| j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl; | ||
| f.parentNode.insertBefore(j, f); | ||
| })(window, document, "script", "dataLayer", "GTM-P4GQM59"); |
There was a problem hiding this comment.
I guess GTM-P4GQM59 is our ID? Do we want to make this overridable via the Sphinx theme config? Do you see any reason why we might want to change this on a per-project basis in the future?
There was a problem hiding this comment.
Hmm good question. I don't see a reason to change this per-project... but it might help for visibility to have it defined in https://github.com/dask/dask-sphinx-theme/blob/main/dask_sphinx_theme/theme.conf
jacobtomlinson
left a comment
There was a problem hiding this comment.
Looks great thanks @scharlottej13
|
I've tagged 3.0.5 so future builds of docs pages should pick up this and we should start seeing metrics rolling in as releases happen. |
|
Sounds good, thanks @jacobtomlinson! |
Adding GTM to the dask theme since read the docs does not support google tag manager (you can only add GA-4 analytics IDs). If we confirm this is working, then we can remove the analytics ID from RTD.
cc @emilyvalentine @jacobtomlinson