diff --git a/pytorch_sphinx_theme/layout.html b/pytorch_sphinx_theme/layout.html
index d84273cb..c3203e3a 100644
--- a/pytorch_sphinx_theme/layout.html
+++ b/pytorch_sphinx_theme/layout.html
@@ -81,7 +81,9 @@
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','{{ theme_analytics_id }}');
+ })(window,document,'script','dataLayer','{{ theme_analytics_id }}');
+ function gtag(){dataLayer.push(arguments);}
+
{% endblock %}