Skip to content

Commit

Permalink
feat: optimize script analytics with lazy loading (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal authored Jul 31, 2023
1 parent 55c0d1a commit 1afa4e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Html, Head, Main, NextScript } from 'next/document'
import Script from 'next/script'

export default function Document() {
return (
Expand Down Expand Up @@ -56,7 +57,9 @@ export default function Document() {
property="discord:invite"
content="https://discord.com/invite/NvK67YnJX5"
/>
<script
<Script
id="my-script"
strategy="lazyOnload"
dangerouslySetInnerHTML={{
__html: `(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],
Expand Down

1 comment on commit 1afa4e7

@vercel
Copy link

@vercel vercel bot commented on 1afa4e7 Jul 31, 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.