Take the 2-minute tour ×

I'm trying to use google anayltics events but so far without any success..

What I'm doing is loading 5 pages using jQuery load function and I want to track the "Next button" for each load. but looks like i'm doing something wrong..

This is the next button event code:

            $('.NextButton').click(function () {
                _gaq.push(['_trackEvent', 'fz_main_page', 'clicked']);
                installation.load_page({ inner_page: next_page, comid: data.comid, outerid: data.outerid, single_app: "1" });

Analytics Code:

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-25162785-2']);
    (function() {

What am I doing wrong?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

It's possible that the installation.load_page function is preventing the trackEvent from firing. Try wrapping your load function in a setTimeout:

setTimeout('installation.load_page({ inner_page: next_page, comid: data.comid, outerid: data.outerid, single_app: "1" })', 100);

Install the Google Analytics Debugger. Look in the console (control, shift, j) for the event tracking processing.

enter image description here

If you don't see all of your events tracking there, then something else is up with the tracking code.

share|improve this answer
Alternatively you could fire the event on mousedown instead of click. The mousedown happens roughly 50ms-200ms before the actual click. So you don't have to mess with timeouts –  Eduardo May 1 '12 at 15:19

Your Answer


