JavaScript frameworks for Google Analytic Tracking

Edit


I have learned that one could do a lot of custom tracking through google analytics for a long time. Yet I don't have time to play with it. Today, I discovered there are javascript libraries to simplify google analytics web tracking javascript code. They are : 


Flare.js: https://github.com/toddmotto/flare

Boba.js: http://boba.space150.com/



After looking at the doc of the 2 libraries. I like the way how Flare.js works more. It has a syntax to embed the tracking data to be send within the html. 

<!-- defaults to `click` -->
<a href="/promotions" data-flare='{
  "category": "KPI sections",
  "action": "click",
  "label": "Visit the promotions",
  "value": 4
}'>Click me</a>

<!-- uses `mouseover` -->
<a href="/promotions" data-flare-event="mouseover" data-flare='{
  "category": "KPI sections",
  "action": "mouseover",
  "label": "Visit the promotions",
  "value": 4
}'>Click me</a>
For me, it is good that the presentation and the logic is together, it could be easily swap in and out without editing multiple location in the sites. Of course, you can arrange the code in a way that Boba.js can achieve this easily swaping in and out of a component. Yet it is much cleaner in the way how Flare.js is doing it. As I am always working on projects that emphasis on OO, reusability, modularization and maintainability, being able to easily switching in and out a component with all the functionality intact is very important.


Source : Two JavaScript frameworks to aid tracking If you've been wanting to up your…
JavaScript frameworks for Google Analytic Tracking JavaScript frameworks for Google Analytic Tracking Reviewed by DF on 6:59:00 PM Rating: 5
©DF. Powered by Blogger.