But what ever happened to separating view from logic? 😐
It seems when it comes to google analytics, all logic jumps out the wind.🤔
I'm still trying to find an advantage to doing it this way 🤔. I mean, is there something special that occurs when you use the
onclick attribute that can't be achieved any other way?
I hereby present ga-click, which was originally an Angular Directive (now in pure JS), restricted to Html Element Attributes that executes google analytic commands beautifully.
You can view a demo here. Forgive my UI 😄 I know it needs work 😋
Now you can write semantic HTML while still tracking your user interactions via google search.
Have fun coding!