Connecting Tech Pros Worldwide Forums | Help | Site Map

Tracking clicks with JS

Merlin
Guest
 
Posts: n/a
#1: May 28 '07
Hi there,

I am wondering if it is possible to track a click on my webpage and
record the destination URL. There is no possibility to ad code into the
<a href tags as I am trying to track the clicks on google adsense banners.

Does anybody have an idea on how to do that? My JS skills are pretty
limited.

Thank you in advance,

Merlin

Evertjan.
Guest
 
Posts: n/a
#2: May 28 '07

re: Tracking clicks with JS


Merlin wrote on 28 mei 2007 in comp.lang.javascript:
Quote:
I am wondering if it is possible to track a click on my webpage and
record the destination URL. There is no possibility to ad code into
the <a href tags as I am trying to track the clicks on google adsense
banners.
Where would you want that information stored?
On the page that get lost after the click?

Why is it not possible to change the page,
if it is your page?

Quote:
Does anybody have an idea on how to do that?
Yes. somebody has.
Quote:
My JS skills are pretty limited.
So you have three options:

- Learn some Javascript.
- Hire a professional.
- Do not follow this quest.
- Use some sorcery, Merlin.

Three!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
David L. Goldberg
Guest
 
Posts: n/a
#3: May 28 '07

re: Tracking clicks with JS


On May 28, 11:17 am, Merlin <ngro...@fastmail.fmwrote:
Quote:
Hi there,
>
I am wondering if it is possible to track a click on my webpage and
record the destination URL. There is no possibility to ad code into the
<a href tags as I am trying to track the clicks on google adsense banners.
>
Does anybody have an idea on how to do that? My JS skills are pretty
limited.
>
Thank you in advance,
>
Merlin
I suppose you might be able to build a system that would rebuild the
add bar? It might be able to reassign all the links in the google
adds to shoot to your site which would store the string and or url of
the advertisement (you can do this via scraping the dom right?) into
your database and then construct this link to the original google
url? Google would still get their click and you would get the stats.
I wonder if this breaks some of their terms of agreement? Can't you
just access this information through google anyway? I have never used
google ads though so have no idea. Not sure if this would work

-David

Randy Webb
Guest
 
Posts: n/a
#4: May 28 '07

re: Tracking clicks with JS


Merlin said the following on 5/28/2007 11:17 AM:
Quote:
Hi there,
>
I am wondering if it is possible to track a click on my webpage and
record the destination URL.
Yes.
Quote:
There is no possibility to ad code into the <a href tags as I am
trying to track the clicks on google adsense banners.
You can add code to the links, you just can't hard code it.
Quote:
Does anybody have an idea on how to do that?
Yes.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Kristin Bruun
Guest
 
Posts: n/a
#5: May 29 '07

re: Tracking clicks with JS


On Mon, 28 May 2007 17:17:56 +0200, Merlin <ngroups@fastmail.fmwrote:
Quote:
Hi there,
>
I am wondering if it is possible to track a click on my webpage and
record the destination URL. There is no possibility to ad code into the
<a href tags as I am trying to track the clicks on google adsense
banners.
>
Does anybody have an idea on how to do that? My JS skills are pretty
limited.
>
Thank you in advance,
>
Merlin
How about _not_ using javascript, but server side technology instead? Most
sites use a url that says
http://my.site.dom/redirectpage/www.new.url/etc/etc

You could solve the problem by setting up one dedicated page, that
extracts the url you send your users to, from the url as shown.
This page's only tasks are to
- track clicks
- redirect your users to the destination url

--
There are 10 kinds of people:
those who know binary, and the others ...
Closed Thread