473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tracking clicks on banners in a generic way?

In the web application I develop, we need to provide the marketing
department with the ability to insert small JavaScript code snippets
into predefined content areas on several pages. This code is supplied
from 3rd parties and may display banners, links and do various other
things. So far so good.

What I need is to track the clicks for each such banner in a generic
way. That is, some javascript or server-side technique that will allow
me to capture and process all the clicks done on this provided JS.
This is like javascript-inside-javascript - you get the idea. Here I
got lost and I'm looking for a solution.

Any ideas?

Thanks a lot for your help!
Jimmy

Oct 26 '06 #1
1 1643
Jimmy said the following on 10/26/2006 7:00 AM:
In the web application I develop, we need to provide the marketing
department with the ability to insert small JavaScript code snippets
into predefined content areas on several pages. This code is supplied
from 3rd parties and may display banners, links and do various other
things. So far so good.

What I need is to track the clicks for each such banner in a generic
way. That is, some javascript or server-side technique that will allow
me to capture and process all the clicks done on this provided JS.
This is like javascript-inside-javascript - you get the idea. Here I
got lost and I'm looking for a solution.

Any ideas?
Lots of ideas. The simplest would be to re-write the snippets so that
rather than pointing at the destination, it points at a file on your
server that would then track the click and issue a Location header to
the actual destination:

<a href="myTrackerFile.php?www.google.com">Google</a>

And then myTrackerFile.php would read the URL, and redirect accordingly
after tracking the click.

Or, another possibility:

<a href="http://www.google.com"
onclick="trackTheClick(this.href)">Google</a>

function trackTheClick(hrefToTrack){
var myImage = new Image();
myImage.src = 'myTrackerFile.php?'+hrefToTrack
}

And then myTrackerFile.php would track the click.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shanfeng Cheng | last post by:
I write a piece of code to tracking the number of clicks on a link each day. The link usu. gets about 3000-6000 clicks per day. I just store today's click count in a one-line text file, like, ...
0
by: Ron Lounsbury | last post by:
We have 2 copies of our web application - Development and Checkout. We have noticed that when the QA quys go through our QA version, they will sometimes find that pages are missing the banners. ...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
4
by: Patrick Rouse | last post by:
Please point me to the correct newsgroup if this is the wrong place to post this question. My website is written in simple HTML and hosted on a windows server at secureserver.net (via GoDaddy). ...
1
by: Jimmy | last post by:
In the asp.net application I develop, we need to provide the marketing department with the ability to insert small JavaScript code snippets into predefined content areas on several pages. This code...
2
by: Crash44 | last post by:
This is driving me quite nuts. I have created several flash banners for a record label. They are meant to link to an artist splash page. Simple enough, right? Both Mac and PC users can click on...
4
by: Merlin | last post by:
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...
1
by: robert.oschler | last post by:
What's a good way to send tracking information to my server when a FORM submission occurs? Right now I build a URL that goes to a server side script that records the information. Then I set an IMG...
3
by: jock1up | last post by:
I am working with javascript...where I have cycling banners at the top, 3 of them and I need to make two of them clickable to a website that I assign to the two. bannerad2 for www.bigmtn.com and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.