File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as tracker from 'ackee-tracker'
22import { useEffect } from 'react'
33
4- import { useSingleton } from '@/common/hooks'
5-
64const DETAILED = true
75
86export const useAckee = ( ) => {
9- const instance = useSingleton ( ( ) => tracker . create ( 'https://ackee.exuanbo.xyz/' ) )
10-
117 useEffect ( ( ) => {
12- const attributes = tracker . attributes ( DETAILED )
13-
148 const { pathname, origin } = window . location
159 const url = new URL ( pathname , origin )
1610
17- const { stop } = instance . record ( 'bc75fd47-884f-4723-aaf6-3384103e0095' , {
18- ...attributes ,
19- siteLocation : url . href ,
20- } )
11+ const { stop } = tracker
12+ . create ( 'https://ackee.exuanbo.xyz/' )
13+ . record ( 'bc75fd47-884f-4723-aaf6-3384103e0095' , {
14+ ...tracker . attributes ( DETAILED ) ,
15+ siteLocation : url . href ,
16+ } )
2117 return stop
22- } , [ instance ] )
18+ } , [ ] )
2319}
You can’t perform that action at this time.
0 commit comments