Skip to content

Commit

Permalink
NEOS-550: updated ga and ls sessions (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Dec 21, 2023
1 parent d19e609 commit 457905b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
22 changes: 19 additions & 3 deletions marketing/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Footer from '@/components/Footer';
import TopNav from '@/components/nav/TopNav';
import GoogleAnalytics from '@/lib/GoogleAnalytics';
import Script from 'next/script';
import '../styles/global.css';

Expand All @@ -12,7 +11,24 @@ export default function RootLayout({
return (
<html lang="en">
<body>
<GoogleAnalytics />
<Script
async
src={`https://www.googletagmanager.com/gtag/js?
id=${process.env.GTAG}`}
></Script>
<Script
id="google-analytics"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.GTAG}');
`,
}}
></Script>

<Script type="text/javascript" id="livesession">
{`
window['__ls_namespace'] = '__ls';
Expand All @@ -26,7 +42,7 @@ window['__ls_script_url'] = 'https://cdn.livesession.io/track.js';
var s = d.getElementsByTagName(t)[0]; s.parentNode.insertBefore(ls, s);
}(window, document, 'script', window['__ls_script_url'], window['__ls_namespace']);
__ls("init", "0201d753.23d48d5d", { keystrokes: false });
__ls("init", "${process.env.LIVESESSION}", { keystrokes: false });
__ls("newPageView");
`}
</Script>
Expand Down
24 changes: 0 additions & 24 deletions marketing/lib/GoogleAnalytics.tsx

This file was deleted.

1 comment on commit 457905b

@vercel
Copy link

@vercel vercel bot commented on 457905b Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.