Forum Moderators: open
[mydomain.com...]
The PID is the session ID and the number increases by one each time its generated on the third parties site.
I need to track the PID/SID if the person clicks a different link on our site.
So if he goes to the home page the PID/SID passes along with the url.
[mydomain.com...]
So no matter where on the my site he goes the PID/SID is attached to that pages url
Thanks in advance!
<%
if request("PID")<>"" then
session("PID") = request("PID")
end if
%>
Then you can use session("PID") anywhere you want - that way you don't need to append the PID to every url.
Setting a cookie might also work and does not use as many system resources.
I think if you have many users, it is not a good idea to set session variables, but someone else might know better.
On your start-page (where the visitor enters) you have something like
<%
Session("SID") = Request.QueryString("PID")
%> (of course you could re-define the sessions PID-value on every page), and then on every link you have
<A HREF="yourpage/index.asp?<%=Session("SID")%>">you link text</A> Instead of a session you could set a cookie...
I think setting a session variable would work, for example:
<%
if request("PID")<>"" then
session("PID") = request("PID")
end if
%>Then you can use session("PID") anywhere you want - that way you don't need to append the PID to every url.
Setting a cookie might also work and does not use as many system resources.
I think if you have many users, it is not a good idea to set session variables, but someone else might know better.
I added:
<%
if request("PID")<>"" then
session("PID") = request("PID")
end if
%>
To the top of everypage, but its not addeing the PID to the urls.
Is there should be something else added to actually add the pid to the url.
[edited by: u4eas at 4:08 pm (utc) on Oct. 10, 2003]
If I understand you correctly this could be a solution (along the line):
On your start-page (where the visitor enters) you have something like<%
Session("SID") = Request.QueryString("PID")
%>(of course you could re-define the sessions PID-value on every page), and then on every link you have
<A HREF="yourpage/index.asp?<%=Session("SID")%>">you link text</A>
This seems to work, but i dont want to change every link on my site:(
Why do you need the PID in every URL?
If you really need it in every URL, you need to change them all.
If you just want to keep track of the PID no matter where the visitor goes, all you have to do id keep it as a session variable and then read it when you need it - for example, to give credit to an affiliate, etc.
The reason is that there is a form on my site that needs to have the PID but its seems I cant keep the pid when I navigate to another page and then go back to the form.
I just added the code to each link to add the PID that way I know it works 100% of the time.
Just wish I knew how to do it without adding the code to each link.
Thanks for you help :)
Just wish I knew how to do it without adding the code to each link.
I don't know your form code, but you have to use something like this to call the URL PID <%=request("PID")%>, instead of it, use <%= session("PID")%>. Of course, you have to set the session variable first, like I showed you on my first post.