Google Analytics

From Documentation

To track the Ajax traffic with Google Analytics or other statistic services, you have to override a client-side API: zAu.beforeSend(String, Event, Desktop). This method will be called each time ZK Client is about to send an Ajax request to the server. You could override it to record the requests on any statistic service you prefer.

Here we use Google Analytics as an example to illustrate how to override it.

try {
var pageTracker = _gat._getTracker("UA-xxxx"); //whatever code your website is assigned

zk.override(zAu, "beforeSend", function (uri, req) {
	try {
		var t =;
		if (t && && (!req.opts || !req.opts.ignorable)) {
			var data =||{},
				value = data.items && data.items[0]?data.items[0].id:data.value;
			pageTracker._trackPageview(uri +"/" + + "/" + + (value?"/"+value:""));
	} catch (e) {
	return zAu.$beforeSend(uri, req);

Of course, you could only record the information you are interested by examining

Version History

Version Date Content

Last Update : 2022/07/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.