-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/src/scripts/main.js b/src/scripts/main.js | ||
index 47294e9b4f4f2dc6628d7e0549028bc11c5a0712..9a3c03ec47ff26e35dac3d51a19156c221fbf262 100644 | ||
--- a/src/scripts/main.js | ||
+++ b/src/scripts/main.js | ||
@@ -429,10 +429,3 @@ export const create = function(server, opts) { | ||
} | ||
|
||
} | ||
- | ||
-// Only run Ackee automatically when executed in a browser environment | ||
-if (isBrowser === true) { | ||
- | ||
- detect() | ||
- | ||
-} | ||
\ No newline at end of file |
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
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,23 @@ | ||
import * as tracker from 'ackee-tracker' | ||
import { useEffect } from 'react' | ||
|
||
import { useSingleton } from '@/common/hooks' | ||
|
||
const DETAILED = true | ||
|
||
export const useAckee = () => { | ||
const instance = useSingleton(() => tracker.create('https://ackee.exuanbo.xyz/')) | ||
|
||
useEffect(() => { | ||
const attributes = tracker.attributes(DETAILED) | ||
|
||
const { pathname, origin } = window.location | ||
const url = new URL(pathname, origin) | ||
|
||
const { stop } = instance.record('bc75fd47-884f-4723-aaf6-3384103e0095', { | ||
...attributes, | ||
siteLocation: url.href, | ||
}) | ||
return stop | ||
}, [instance]) | ||
} |
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