Switch to GA2

This commit is contained in:
Kovid Goyal 2022-06-30 17:00:14 +05:30
parent 86357d2c38
commit 4ed413eaa7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 12 deletions

View File

@ -4,18 +4,14 @@
{{ super() }}
{%- if analytics_id %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ analytics_id }}']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
gtag('config', '{{ analytics_id }}');
</script>
{% endif -%}

View File

@ -92,7 +92,7 @@ def run_man(args: Any) -> None:
def run_html(args: Any) -> None:
call('make FAIL_WARN=1 "OPTS=-D analytics_id=UA-20736318-2" dirhtml', cwd=docs_dir)
call('make FAIL_WARN=1 "OPTS=-D analytics_id=G-XTJK3R7GF2" dirhtml', cwd=docs_dir)
add_old_redirects('docs/_build/dirhtml')