Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e9176877
Unverified
Commit
e9176877
authored
Feb 16, 2021
by
Ségolène Alquier
Committed by
GitHub
Feb 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[examples] Replace the GA_TRACKING_ID string with env variable (#21817)
parent
c64005ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
.env.local.example
examples/with-google-analytics/.env.local.example
+1
-0
gtag.js
examples/with-google-analytics/lib/gtag.js
+1
-1
No files found.
examples/with-google-analytics/.env.local.example
0 → 100644
View file @
e9176877
NEXT_PUBLIC_GA_ID=123
examples/with-google-analytics/lib/gtag.js
View file @
e9176877
export
const
GA_TRACKING_ID
=
'<YOUR_GA_TRACKING_ID>'
export
const
GA_TRACKING_ID
=
process
.
env
.
NEXT_PUBLIC_GA_ID
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
export
const
pageview
=
(
url
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment