-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from onflow/nialexsan/gtag
Looks great!
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import PropTypes from "prop-types"; | ||
import Script from 'next/script' | ||
|
||
export default function GTag({ gtagId }) { | ||
return (<> | ||
<Script async src={`https://www.googletagmanager.com/gtag/js?id=${gtagId}`}></Script> | ||
<Script id="google-analytics"> | ||
{` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${gtagId}'); | ||
`} | ||
</Script> | ||
</> | ||
); | ||
} | ||
|
||
GTag.propTypes = { | ||
gtagId: PropTypes.string, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export const HOST_API = process.env.NEXT_PUBLIC_HOST_API; | ||
export const GTAG_ID = process.env.GTAG_ID || "" |
5d40575
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cadence-cookbook – ./
cadence-cookbook.vercel.app
cadence-cookbook-git-main-onflow.vercel.app
cadence-cookbook-onflow.vercel.app
cookbook.onflow.org
cookbook.flow.com
open-cadence.onflow.org