Track Events with Google Analytics

Asynchronous Complete Google Analytics with jQuery

Here is how to track all clicks on your website using google analytics asynchronously.

First in your html you need to use jQuery and a javscript file I named yga.js:

And here is the yga.js file:

Replace the: UA-XXXXXXXX-1 by your google analytics code and you’re done.

To see what occurs, simply go in Content and Event Tracking as shown in the following screenshot:

Happy tracking!

Comments

comments powered by Disqus
Published on 2010-06-17
Follow @yogsototh
Yann Esposito©
Done with Vim spacemacs & nanoc Hakyll

ADA: DdzFFzCqrhtAvdkmATx5Fm8NPJViDy85ZBw13p4XcNzVzvQg8e3vWLXq23JQWFxPEXK6Kvhaxxe7oJt4VMYHxpA2vtCFiP8fziohN6Yp