Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nc-31b78819
  • Loading branch information
docschina-bot committed Oct 16, 2023
2 parents b55923b + 31b7881 commit edf924c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ const MyDocument = () => {
return (
<Html lang={siteConfig.languageCode} dir={siteConfig.isRTL ? 'rtl' : 'ltr'}>
<Head />
<script
async
src={`https://www.googletagmanager.com/gtag/js?id=${siteConfig.googleAnalyticsTagId}`}
/>
<script
dangerouslySetInnerHTML={{
__html: `window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '${siteConfig.googleAnalyticsTagId}');`,
}}
/>
<body className="font-text font-medium antialiased text-lg bg-wash dark:bg-wash-dark text-secondary dark:text-secondary-dark leading-base">
<script
dangerouslySetInnerHTML={{
Expand Down
1 change: 1 addition & 0 deletions src/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ exports.siteConfig = {
apiKey: 'e8451218980a351815563de007648b00',
indexName: 'beta-react',
},
googleAnalyticsTagId: 'G-B1E83PJ3RT',
};

0 comments on commit edf924c

Please sign in to comment.