[SOLVED]Google Analytics Tracking Event(s) in form

SAGO 26 Jan, 2012
Hi,

Using V3.2 with Joomla 1.5.25

I've did some research about Tracking Events and I'd like to add some tracking to specific elements in the form like when someone clicks the upload button and also when a form is submitted.

Up until now I haven't got this working.

The info about Tracking Event(s) can be found here: http://code.google.com/intl/nl/apis/analytics/docs/tracking/eventTrackerGuide.html

This is one of their examples.
<a href="#" onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby\'s First Birthday']);">Play</a>


So I added something similar in a input field and have this:
<input type="file" onclick="_gaq.push(['_trackEvent', 'Video Upload', 'clicked'])" name="video" id="file_9" size="20" title="" class="cf_fileinput cf_inputbox">


So I just added:
onclick="_gaq.push(['_trackEvent', 'Video Upload', 'clicked'])"


By the way I also have AG Google Analytics component and plugin (from JED) and set it up and I get normal results in google analytics account.

My site: http://tiny.cc/2lu44 for in case you want to check it with firebug for instance.

Alsi in my <head>-tag I can see:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxx-1']);
_gaq.push(['_setCustomVar', 1, 'user_ip', 'xx.xx.xx.xxx', 1]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})(); 


And also this:
<script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js">


So I think that part is ok.

1) Why Did I do something wrong the way I added onclick="_gaq.push(['_trackEvent', 'Video Upload', 'clicked'])"
2) How would I add a tracking for when submitting the form. Do I place a similar code and also use onclick in <input type="submit" name="button_1" value="Sumbit"> or do I need to put some code in the FORM HTML CODE (in the submit after)?
3) anything else I'm doing wrong or advice?


Thanks in advance.
SAGO 09 Feb, 2012
Solved.
This didn't have to do anything with Chronoforms.
When using Google Analytics it takes up to 36 hours before it shows the result.

Cheers
This topic is locked and no more replies can be posted.