Add ability to prevent tracking on specific domains
rileyamos opened this issue · comments
RILS commented
Issue:
Currently, gatsby-plugin-fathom will log analytics while in the development environment (ie. localhost). This is not ideal as it creates noise in the overall analytics data.
Request:
Implement a domain blacklist which would ensure that analytics are not tracked if Fathom is triggered from a domain on the list.
A example implementation can be found in the Fathom documentation:
https://usefathom.com/support/localhost
Ideally we would be able to configure the list in the gatsby-config.js
, like so:
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-fathom',
options: {
// Fathom server URL. Defaults to `cdn.usefathom.com`
trackingUrl: 'your-fathom-instance.com',
// Unique site id
siteId: 'FATHOM_SITE_ID',
// Domain Blacklist
fathomExcludeHostnames: ['localhost']
}
}
]
}
Lars Graubner commented
Sounds useful. Feel free to provide a PR.
Dan Liburd commented
Hi all, I'm happy to take this on @lgraubner @rileyamos
Lars Graubner commented
@libuk Go for it! 👍