Advertisement

05.10.2006 at 12:23PM PDT, ID: 21845709
[x]
Attachment Details

Click Tracking with Ajax

Asked by headzoo in JavaScript

Tags: tracking, click, javascript, ajax

Howdy,
I'm trying to write an outbound link tracking script using Ajax.  The problem I'm having is the links are only being recorded by the backend PHP script half the time.  I think the problem is the page moves onto the link's location before the Ajax script has had a chance to send the information to the backend scripts.  I've had the same problem using other types of JavaScript tracking, and I've inserted a short pause before the browser moves onto the link location, to give the script time to do it's thing.

Is there a way to keep the browser from moving onto the link's location until the Ajax script get a response from the backend?  I tried creating a function for the Ajax script to call when it gets a response, and then it uses window.location to send the browser to the link's location, but for various reasons that's not satisfactory.Start Free Trial
 
Loading Advertisement...
 
[+][-]05.10.2006 at 01:45PM PDT, ID: 16652677

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: tracking, click, javascript, ajax
Sign Up Now!
Solution Provided By: Zvonko
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.10.2006 at 01:49PM PDT, ID: 16652714

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2006 at 08:18PM PDT, ID: 16672425

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2006 at 07:34PM PDT, ID: 16687257

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32