File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,11 +8,7 @@ import React, {
88 useState ,
99} from 'react'
1010
11- import {
12- constants ,
13- getDefaultUserPlan ,
14- UserPlan ,
15- } from '@brunolemos/devhub-core'
11+ import { constants , UserPlan } from '@brunolemos/devhub-core'
1612import { getDefaultDevHubHeaders } from '../helpers'
1713
1814export interface AuthProviderProps {
@@ -111,11 +107,12 @@ export function AuthProvider(props: AuthProviderProps) {
111107 } , [ JSON . stringify ( authData ) ] )
112108
113109 useEffect ( ( ) => {
114- if ( typeof window === 'undefined' || typeof window . gtag === 'undefined' )
115- return
110+ if ( typeof gtag === 'undefined' ) return
116111
117112 if ( authData && authData . _id ) {
118- window . gtag ( 'set' , { user_id : authData && authData . _id } )
113+ gtag ( 'config' , 'UA-52350759-6' , {
114+ user_id : ( authData && authData . _id ) || undefined ,
115+ } )
119116 }
120117 } , [ authData && authData . _id ] )
121118
@@ -482,7 +479,5 @@ function saveOnCache(auth: AuthData | undefined) {
482479}
483480
484481declare global {
485- interface Window {
486- gtag ?: ( ...args : any [ ] ) => void
487- }
482+ const gtag : ( ( ...args : any [ ] ) => void ) | undefined
488483}
You can’t perform that action at this time.
0 commit comments