Return to Snippet

Revision: 60231
at October 26, 2012 06:47 by nivasgallo


Updated Code
<a href="#contact" rel="contact">Contact</a>

<script>
$(document).ready(function(){
    // 
    loadOnClick();

    function loadOnClick() {
        $('a').each(function(){
            $(this).attr("onclick", "_gaq.push(['_trackPageview', location.pathname + location.search + jQuery(this).attr('rel')]);" );
        });
    }
});
</script>

Revision: 60230
at October 26, 2012 06:46 by nivasgallo


Updated Code
<a href="#contact" rel="contact">Contact</a>
<script>
// 
loadOnClick();

function loadOnClick() {
    $('a').each(function(){
        $(this).attr("onclick", "_gaq.push(['_trackPageview', location.pathname + location.search + jQuery(this).attr('rel')]);" );
    });
}
</script>

Revision: 60229
at October 26, 2012 06:40 by nivasgallo


Initial Code
<a href="#contact" rel="contact">Contact</a>
// 
loadOnClick();

function loadOnClick() {
    $('a').each(function(){
        $(this).attr("onclick", "_gaq.push(['_trackPageview', location.pathname + location.search + jQuery(this).attr('rel')]);" );
    });
}

Initial URL

                                

Initial Description
This code allows Google Analytics to monitor hashtags of jQuery activated events. Very useful if you relies on modal boxes. 

Este código permite ao Google Analytics monitorar hashtags e âncoras em sites com eventos ativados por jQuery. Muito útil se você utiliza caixas modais.

Initial Title
Track clicks on #hash anchor links on Google Analytics

Initial Tags
jquery

Initial Language
jQuery