Skip to content

Commit

Permalink
Add New GTAG
Browse files Browse the repository at this point in the history
Re: pytorch/pytorch.github.io#1397

Adding the new GTAG to populate on all sites that use pytorch_sphinx_theme.
  • Loading branch information
Svetlana Karslioglu authored Jun 15, 2023
1 parent a1dbd5c commit 14a49da
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions pytorch_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,13 @@
{%- endblock %}

{%- block extrahead %}
<!-- Google Analytics -->
{% if theme_analytics_id %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ theme_analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ theme_analytics_id }}');
</script>
{% endif %}
<!-- End Google Analytics -->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T8XT4PS');</script>
<!-- End Google Tag Manager -->
{% endblock %}

{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
Expand Down Expand Up @@ -321,6 +316,10 @@
{% endif %}

{%- block content %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T8XT4PS"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% if theme_style_external_links|tobool %}
<div class="rst-content style-external-links">
{% else %}
Expand Down

0 comments on commit 14a49da

Please sign in to comment.