dan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
src/pages/_app.tsx
|
|
@ -15,6 +15,7 @@ import '../styles/sandpack.css'; |
|
|
|
if (typeof window !== 'undefined') { |
|
|
|
if (process.env.NODE_ENV === 'production') { |
|
|
|
ga('create', process.env.NEXT_PUBLIC_GA_TRACKING_ID, 'auto'); |
|
|
|
ga('send', 'pageview'); |
|
|
|
} |
|
|
|
const terminationEvent = 'onpagehide' in window ? 'pagehide' : 'unload'; |
|
|
|
window.addEventListener(terminationEvent, function () { |
|
|
|