473,397 Members | 2,084 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,397 software developers and data experts.

Tracking link clicks reliably

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 element's
SRC attribute to that URL. In Internet Explorer, I do this operation
in the form submit handler and in FireFox, in an event listener for
the form.

In either case when I test it, I see that I'm missing a lot of data.
I'm wondering if the browser isn't bothering to actually set the IMG
SRC attribute since it is exiting the document.

Is there a more reliable way to get the tracking data out to my
server? Preferably a Javascript method?

Would executing the operation from the OnClick handler be more
reliable than my current method?

Jun 23 '07 #1
1 1437
ro************@gmail.com said the following on 6/22/2007 10:16 PM:
What's a good way to send tracking information to my server when a
FORM submission occurs?
Put your tracking information in a hidden field, submit the form, let
the server pull out the information and log it.
Right now I build a URL that goes to a server
side script that records the information. Then I set an IMG element's
SRC attribute to that URL. In Internet Explorer, I do this operation
in the form submit handler and in FireFox, in an event listener for
the form.
Bad idea.
In either case when I test it, I see that I'm missing a lot of data.
I'm wondering if the browser isn't bothering to actually set the IMG
SRC attribute since it is exiting the document.
No, it is setting the SRC property and then navigating away which
cancels the request from the server and it never gets there.
Is there a more reliable way to get the tracking data out to my
server? Preferably a Javascript method?
See above.
Would executing the operation from the OnClick handler be more
reliable than my current method?
No. Read above.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 23 '07 #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, ...
2
by: David Frauzel | last post by:
I'm writing a rough draft of a suite of small Perl apps that will, combined, serve as a web site's user sign-up, login, management, and customized content engine. I'm having trouble with the...
1
by: Dennis M. Marks | last post by:
I know that ad companies can track sites that contain their ads that you have visited. This is used to tailor the ads that you see. Does anyone know where I can find detailed information on how...
5
by: brian | last post by:
I have an intranet designed with access to many reports by clicking a link. The link will open a specified report. I use a login and session variable. I want to track when an employee clicks a...
1
by: Jimmy | last post by:
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...
3
by: brett | last post by:
Are there any ASP.NET (2.0) (AJAX) tools that allow you to track the number of cliks a particular link is getting? I'd like to sell ad space and trade links with other people but want a way to...
1
by: bdockery | last post by:
So I figured out that if you use this html: http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=<TRACKING...
7
by: Ben Amada | last post by:
Hi ... I have an HTML page containing a bunch of <alinks. Some of the links redirect the visitor to a page at a different website in a new browser window (target=_blank) and other links are...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.