theodinproject icon indicating copy to clipboard operation
theodinproject copied to clipboard

Chore: Dashboard Button Tracking in Google Analytics

Open KevinMulhern opened this issue 3 years ago • 1 comments
trafficstars

Description

We don't have any visibility of dashboard button usage in GA.

Acceptance Criteria

  • Track "Resume" button clicks
  • Track "Start" button clicks
  • Track "Open" button clicks

Additional Information

All of our GA tracking code is in this file: https://github.com/TheOdinProject/theodinproject/blob/main/app/javascript/src/js/analytics.js

example event: _gaq.push(['_trackEvent', 'dashboard_buttons', 'resume', 'dashboard', 1]);

KevinMulhern avatar Aug 10 '22 07:08 KevinMulhern

On a somewhat related note, I had this question when I looked at analytics.js: Is there any significant performance hit from using that many $ calls instead of, say, using the onclick attribute? There's a good Stack Overflow answer for this question: https://stackoverflow.com/questions/19973329/jquery-performance-on-versus-onclick TL;DR: No, it shouldn't matter. (Sorry in advance if this an already known fact, I'm new to the Odin Project)

FnControlOption avatar Aug 11 '22 22:08 FnControlOption

Thats a good call out @FnControlOption. We haven't noticed anything significant in our performance monitoring tools. But it is likely having some impact.

The tracking code could do with being refactored and modernised. We could also get rid of the trackers for every internal and external link. Those have never been useful in all the time I've been here.

KevinMulhern avatar Aug 13 '22 11:08 KevinMulhern

I could work on this. Would it be worth removing the jquery at the same time?

bscottnz avatar Aug 25 '22 03:08 bscottnz

Would it be worth removing the jquery at the same time?

I didn't want to saddle anyone with that when creating the story 😆
But if you're up for doing it, absolutely mate.

KevinMulhern avatar Aug 25 '22 08:08 KevinMulhern

yeah its cool, ill wash my hands after don't worry

bscottnz avatar Aug 25 '22 08:08 bscottnz