rstudio / rsconnect-jupyter

Publish Jupyter notebooks to RStudio Connect
GNU General Public License v2.0
25 stars 6 forks source link

New Google Analytics Tracking Code #356

Closed hronrade closed 1 year ago

hronrade commented 1 year ago

System details

Connect Version : 
OS Version      :
Auth Provider   :
R Version       :
Python Version  :

Origin of Bug

Link to customer ticket, ProdPad, discussion, etc. @awilliams1275

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 <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) -->

Steps to Reproduce

Actual Behavior

Expected Behavior

hronrade commented 1 year ago

Related: https://github.com/rstudio/connect/issues/23201#event-8744088090 https://github.com/rstudio/rsconnect-jupyter/issues/366

whimsicallyson commented 1 year ago

completed with https://github.com/rstudio/rsconnect-jupyter/pull/359