Skip to content

Commit

Permalink
PORTALS-2821: migrate portals to GTM (which should still send data to…
Browse files Browse the repository at this point in the history
… the existing GAv4 stream)
  • Loading branch information
jay-hodgson committed Oct 17, 2023
1 parent bd14a14 commit 24c74d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 38 deletions.
22 changes: 11 additions & 11 deletions apps/portals/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,14 @@
<script src="https://unpkg.com/markdown-it-br@1.0.0/dist/markdown-it-br.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/markdown-it-container@2.0.0/dist/markdown-it-container.min.js"></script>
<script src="/js/back-forward-nav-handler.js"></script>
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-CEKFPZDZX7"
></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())
gtag('config', 'G-CEKFPZDZX7')
<!-- 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-KPW4KS62');
</script>
<!-- End Google Tag Manager -->
<script type="module">
/* Fix polyfill issues with vite and @apidevtools/json-schema-ref-parser */
import { Buffer } from 'buffer'
Expand All @@ -110,6 +106,10 @@
<script type="module" src="./src/index.tsx"></script>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KPW4KS62"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
3 changes: 0 additions & 3 deletions apps/portals/src/AppInitializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
SynapseClient,
SynapseConstants,
} from 'synapse-react-client'
import useAnalytics from './useAnalytics'
import { useLogInDialogContext } from './LogInDialogContext'

const COOKIE_CONFIG_KEY = 'org.sagebionetworks.security.cookies.portal.config'
Expand Down Expand Up @@ -43,8 +42,6 @@ function AppInitializer(props: React.PropsWithChildren<Record<never, never>>) {

useSetDocumentMetadataFromConfig()

useAnalytics()

useEffect(() => {
/**
* PORTALS-490: Set Synapse callback cookie
Expand Down
24 changes: 0 additions & 24 deletions apps/portals/src/useAnalytics.ts

This file was deleted.

0 comments on commit 24c74d3

Please sign in to comment.