Hi

This topic is very interesting.

I would like to recommend Cesar Rodas. I will study this ASAP.

http://www.phpclasses.org/browse/package/4012.html

He have a class to track clicks without AJAX.

He is using an image tag.

He said to me

"The image tag is quite simple, is for emulate an AJAX request, but ajax
request works only for the same host, so what I do is create a new image
object and put there the image request, example:

<img src="phparchive.php?param1=param2">

The object is generated in javascript and the phparchive.php returns an
empty image or you can hide the result. "

We could try convert this idea to Jquery. Gstats is GNU General Public
License (GPL).

I didnt study yet, like I said. But seem to be a good solution.

So I think that when the browser try read the <img> the server can get the
parameters. without AJAX! (I guess!)

Regards

Mario Moura
macm

2007/12/11, Chris Hardy <[EMAIL PROTECTED]>:
>
>
> I'm not an expert with jQuery, but I think something like this might do
> the
> trick..
>
> $("a.adtrack").click(function(){
>     // Get url of advert
>     var adURL = $(this).attr("href");
>
>     // Log click to database
>     $.ajax({
>         type: "GET",
>         url: "/path/to/tracking/script.asp",
>         data: "advertURL=" + adURL;
>     });
>
>     // Redirect to target URL
>     window.location = adURL;
> });
>
> Give your links a class of "adtrack"....
>
> <a href="http://www.someurl.com/"; class="adtrack">Go to Some URL</a>
>
> Then you can go about setting up your tracking script to request the URL
> from the querystring and log it to the database.
>
> --------------------------------------------------
> From: "Darren Savery" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 11, 2007 4:50 PM
> To: "jQuery (English)" <jquery-en@googlegroups.com>
> Subject: [jQuery] Using jQuery to track advert clicks
>
> >
> > Hi,
> >
> > Is it possible to use jQuery to track advert clicks? I have adverts
> > that appear on certain pages of my site. Whenever someone clicks on an
> > advert, I would like to record this as a new entry in a database table
> > (tblAdvertClicks).
> >
> > I know I could pass the visitor to a processing page then forward them
> > on to the advert destination, but I want the link to do directly from
> > my site to the advertisers - without a 3rd page being involved (this
> > is for SEO purposes in case anyone is interested). Someone suggested
> > jQuery could do this.
> >
> > Can anyone help?
> >
> >
>



-- 
Prezado(a)s Sr(a)s



Atenciosamente,

Mário Alberto Chaves Moura
[EMAIL PROTECTED]
Av. Raja Gabaglia, 4859 / 209
Belo Horizonte MG 30360670
31-3264-6203
31-9157-6000

Reply via email to