Git Product home page Git Product logo

gatsby-plugin-fathom's People

Contributors

alexlafroscia avatar dependabot[bot] avatar jackellis avatar lgraubner avatar libuk avatar philippbosch avatar yanneves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gatsby-plugin-fathom's Issues

(Ignore this issue duplicate)

This plugin doesn't work any longer, and its deprecation is mentioned in this Github repo's readme and on https://www.npmjs.com/package/gatsby-plugin-fathom, but it is not mentioned in either https://www.gatsbyjs.com/plugins/gatsby-plugin-fathom/ nor https://www.npmjs.com/package/gatsby-plugin-fathom-v2 (which seems like something that ought to work given https://www.npmjs.com/package/gatsby-plugin-fathom being deprecated).

What even is the -v2 npm package? All in all, this is rather confusing...

Default instance URL to Fathom CDN

If you're paying for Fathom, you can (should?) use Fathom's own hosted version of the tracker script rather than the one hosted by your own instance.

I think it would make sense to default the instance URL to cdn.usefathom.com and document in the REAMDE that you can just provide the tracking ID if you're using the hosted version.

If you like that idea, I'd be happy to make a PR that makes those changes!

Add ability to prevent tracking on specific domains

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

Update to latest version of tracking code

The current tracking code used by this plugin is not the latest tracking code and doesn't support new fathom features such as fathom.blockTrackingForMe().

I would like to work on a pull request for this, I think adding an option to allow site owners to choose between the old embed code and new one is the most appropriate route. Does anyone have any opinions on this?

Include some comments on why to use Fathom

When printing out the tracking snippet in the gatsby-ssr.js file, you could add an html comment like:

<!-- Fathom - simple website analytics - https://usefathom.com/ref/{your referral code maybe} for $10 off -->
<!-- Why you'll love using Fathom over Google Analytics:

- You don't need to display those pesky cookie notices as Fathom doesn't use cookies, nor do they track invasive data.
- Fathom offers simple, straight-forward website analytics.
- Fathom is focused on privacy for website visitors, they don't track them, save their personal information, or need it to be profitable.
- Fathom has hundreds of customers and track tens of millions of page views per month, so they might be a small company, but are doing big things.
- Fathom can handle viral content without breaking a sweat, so your site won't slow down because of them, and they don't ever stop tracking you because of a spike in popularity.
- All of their plans allow for **unlimited** websites to be tracked 
-->

Now you could either:

  • Include your ref-code there
  • or allow in the options the user to set theirs there

Clarify deprecation notices across the places this package is advertised

This plugin doesn't work any longer, and its deprecation is mentioned in this Github repo's readme and on https://www.npmjs.com/package/gatsby-plugin-fathom, but it is not mentioned in either https://www.gatsbyjs.com/plugins/gatsby-plugin-fathom/ nor https://www.npmjs.com/package/gatsby-plugin-fathom-v2 (which seems like something that ought to work given https://www.npmjs.com/package/gatsby-plugin-fathom being deprecated).

What even is the -v2 npm package? All in all, this is rather confusing...

How to use custom domain?

For the simple snippet, we can use

<script src="https://cdn.usefathom.com/3.js" site="###"></script>
<script>
    window.fathom || document.write('<script src="###/core.js"><\/script>');
</script>

If we were to use trackingUrl we would be greeted with a TypeError: e is null

var e = document.querySelector('script[src*="cdn.usefathom.com"]'),
  t = {
    siteId: e.getAttribute('site'),
    spa: e.getAttribute('spa'),
    trackerUrl: '###'
  };

Any idea on how to bypass adblockers?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.