Merge pull request #1915 from slumbering/fix-amplitude-init

init amplitude with appropriate ID
This commit is contained in:
Jffarge 2022-03-29 14:10:58 +02:00 committed by GitHub
commit 23ab465c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,9 @@ function DocPage(props) {
// DocPage Swizzle // DocPage Swizzle
useEffect(() => { useEffect(() => {
var instance1 = amplitude.getInstance().init(process.env.REACT_APP_AMPLITUDE_ID, null, {
apiEndpoint: `${window.location.hostname}/t`
})
amplitude.getInstance().logEvent('Docs Viewed', { "hostname": window.location.hostname, "path": location.pathname }); amplitude.getInstance().logEvent('Docs Viewed', { "hostname": window.location.hostname, "path": location.pathname });
}, [location.pathname]) }, [location.pathname])
// End DocPageSwizzle // End DocPageSwizzle