raae/pow-app

Add goal tracking to the export feature

Closed this issue ยท 2 comments

raae commented

When the user clicks the export button it should be tracked.

  1. Add GATSBY_FATHOM_EXPORT to your .env.development (any value will due)
  2. Export FATHOM_EXPORT from ./constants
  3. Import the trackGoal function from the tracking feature.
  4. Import FATHOM_EXPORT from ./constants
  5. When button is clicked call trackGoal with FATHOM_EXPORT as param
  6. Test and make sure the console logs out Track fathom goal <FATHOM_EXPORT>)

I will add a real value to Netlify env variables so this will be tracked properly by fathom in production.

Question about
5. When button is clicked call trackGoal with FATHOM_EXPORT as param
A. Should trackGoal be called after openSaveFileDialog? or
B. Should trackGoal be called before openSaveFileDialog?

I am currently going with "B", but you're the POW! Queen @raae ๐Ÿ‘‘ so it's your call.

raae commented

Let's do before, as if it fails the intent of the user is still to export. Later we can add some error tracking. Ie B as you suggested.