Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking Affiliates 1

Status
Not open for further replies.

netctl

MIS
Oct 1, 2004
7
0
0
CA
Hi Guys,
I was wondering if anyone knows of a way to track Affiliates in this situation.
Users get to the website from Affiliates sites tracked by a querystring AffID=1 for example
what i need to do is to keep that AffID until the user exits the site.
on the site theres an application page that is hosted on a nother domain and i need to know if any user have completed that application and if they had came from one of the Affiliates so we can credit them.
C# or VB,net code would be greatly appreciated.

Thanks for your thoughts

 
There is no good way to determine if someone exits a site, kills a browser or navigates the browser to another site.

Servers keep track of page request there is not such thing as page exit event since there is no continues live connection between the client and the server.

The closest thing that will work is the onbeforunload event for the browser window.
With this you need to build a simple NotifyLeavingPage.aspx
page that will accept a post and do what ever you want with the AFFID.

Code:
<script id=dummy1 src=""></script>
<head>
<script language=javascript>
window.onbeforeunload = notifyserver()
</script>
</head>

<body>
..Body Stuff ...
<% ="<sc" &  "ript language=javascript>" %>

function notifyserver(){
document.getElementById("dummy1").src='NotifyLeavingPage.aspx?AFFId=" & Request("AFFID") & "'
return null;
}

<% ="</sc" & "ript>" %>

..Body Stuff ...
</body>
 
Thanks for the Reply RTomes.
I was trying to avoid using the client side scripts but unless the client starts to do more cooperating I guess I will be stuck with JS.

Thank you, I will give that a try and let you know the outcome.



 
That may need some tweaking, it is just a concept.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top