lgraubner / gatsby-plugin-fathom

Gatsby plugin to add Fathom tracking to your site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to prevent tracking on specific domains

rileyamos opened this issue · comments

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']
      }
    }
  ]
}

Sounds useful. Feel free to provide a PR.

Hi all, I'm happy to take this on @lgraubner @rileyamos

@libuk Go for it! 👍