Put your hooks into it

All right – let’s tackle something a bit more advanced now… As with all products, there is always people who are not satisfied with the out-of-the-box features, and would like things to work a bit differently… Our Web Analytics Connector was no exception. So for all of you tinkerers out there, we have created a couple of "hooks" – javascript functions that act as point of entries in our normal GoogleAnalytics mechanism so you can complement it and/or customize it. Without further ado, ladies and gents, here they are…

  • function monitus_customize_ga_tracker(pageTracker) This function allows you to customize the tracker object, passed to you as the pageTracker variable. Please be careful which property you modify though, so you don’t break the cross-domain tracking… But it could be used for custom variables, for instance. This is called right before the call to pageTracker._trackPageview();
  • function monitus_final_callback() Our most famous hook! This function is called right after our code has sent the page view to Google Analytics. Particularly useful to build your own tracker object and not mess-up the GA cookies. Or to run any code that requires the tracking object to exist and the cookies to be set.

One last note: for those who need them, monitus potentially creates two tracker objects. The main tracker object is _MONITUS.pageTracker, and if you use our new Google Website Optimizer wizard, you also have access to it’s tracker object: _MONITUS.woTracker.

I hope you will find you have quite enough control to customize the GA tracking with just these two hooks… If not, please, by all means, let us know and we’ll see what we can do!