Skip to content

Commit

Permalink
fix: adblocker errors
Browse files Browse the repository at this point in the history
If people use adblockers, the page routing would break. This now is now being handled.
  • Loading branch information
lostdesign committed Apr 24, 2022
1 parent 9511999 commit f3ca730
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions middleware/fathom.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ const { namespace } = options

Middleware[namespace] = ({ app, route }) => {
if(process.client) {
app.$fathom.trackPageview({
url: route.fullPath
})
try {
app.$fathom?.trackPageview({
url: route.fullPath
})
} catch (error) {
// possibility that an adblocker is being used...
console.log(error)
}
}
}

0 comments on commit f3ca730

Please sign in to comment.