On published pages, the <script> tag should appear in the head of the documents, and the noscript tag should appear in the
of the documents.
Paste this code as high in the <head> of the page as possible:
<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-KHBDBW7');</script>
<!-- End Google Tag Manager -->
Additionally, paste this code immediately after the opening <body> tag:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KHBDBW7" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
System details
Origin of Bug
Problem Statement
The new Google Tag Manager Tracking code to place on your websites is below. It replaces any Google Analytics code currently in use.
This needs to be done ASAP - once the legacy GA tracking is retired, we will completely lose GA for our docs.
Please direct all questions to @awilliams1275
Any questions, please reply here, and feel free to also Slack/email: #ga4-migration, Andrew.williams@posit.co.
On published pages, the
of the documents.<script>
tag should appear in thehead
of the documents, and thenoscript
tag should appear in thePaste this code as high in the
<head>
of the page as possible:Additionally, paste this code immediately after the opening
<body>
tag:Steps to Reproduce
Actual Behavior
Expected Behavior