Skip to content

Commit

Permalink
Update fathom
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlovin committed Dec 31, 2019
1 parent 63a2dac commit 3536b9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:staged": "lint-staged"
},
"dependencies": {
"fathom-client": "^1.0.0",
"fathom-client": "^2.0.2",
"next": "^9.1.6",
"next-seo": "^3.2.0",
"react": "^16.12.0",
Expand Down
16 changes: 8 additions & 8 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as React from 'react'
import App from 'next/app';
import Fathom from 'fathom-client'
import { trackPageview, load, setSiteId } from 'fathom-client'
import Router from 'next/router'
import Providers from '../components/Providers';

Router.events.on('routeChangeComplete', () => {
Fathom.trackPageview()
trackPageview()
})

function FathomWrapper(props) {
function FathomProvider(props) {
React.useEffect(() => {
if (process.env.NODE_ENV === 'production') {
Fathom.load();
Fathom.setSiteId('ESMHTGZE');
Fathom.trackPageview();
load();
setSiteId('ESMHTGZE');
trackPageview();
}
}, [])
return <div {...props} />
Expand All @@ -23,11 +23,11 @@ class MyApp extends App {
render() {
const { Component, pageProps } = this.props;
return (
<FathomWrapper>
<FathomProvider>
<Providers>
<Component {...pageProps} />
</Providers>
</FathomWrapper>
</FathomProvider>
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3822,10 +3822,10 @@ fastq@^1.6.0:
dependencies:
reusify "^1.0.0"

fathom-client@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-1.0.0.tgz#de3127a9555081983654375789e665cc2e938c74"
integrity sha512-YUJJHGOm9KOIjoZDnQeCCPOKu28t6k+hPD49rGAV1/HTknAIDb8J2u5foPg2JgsWcB4ORvJjN/7xSTUPvRK4/Q==
fathom-client@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/fathom-client/-/fathom-client-2.0.2.tgz#83c66b9c0111478ff75004563ea58f8dcf692c2d"
integrity sha512-2OvYKIuuSKwx658rSPwTMDXmRLUdNh4N2KzQCUHJUTVaCdK1Tv49zeJd3ovgIeont/r+1wk/7Ri/sMzoHY5MXw==

fd-slicer@~1.0.1:
version "1.0.1"
Expand Down

0 comments on commit 3536b9d

Please sign in to comment.