Page 1 of 1

PHP questions

Posted: Thu May 12, 2005 3:29 pm
by jaymoore_299
I am new to php programming.

I have many referrers that I need to keep track of in order to manage my out traffic accordingly. In order to do this, I need to know the domains the surfers are coming from. What is the best way to do this? I heard that HTTP_REFERER is browser optional so this information may not be sent. Should I request my referrers use a url like http://www..com/?id=342233 or use sessions? I want to have something that works whether the surfer has javascript, cookies enabled or disabled.

Posted: Thu May 12, 2005 3:31 pm
by Revan
id? method is the norm.

Posted: Thu May 12, 2005 4:42 pm
by Burrito
you say "manage your out traffic" do you mean you want to keep track of hits from people leaving your site, or you want to track from where your hits are coming?

if it's the latter, you could always tag on a url var (if you're doing some kind of link campaign) and then dump the value of that var into a db upon arrival to your site. With that schema, you won't be able to track "random" hits to your site however as the party on the other end will have to place a var in the url string to your site in order for that to work. Honestly (albeit flaky) your best solution for tracking incoming hits is HTTP_REFERER.

Burrito

Posted: Thu May 12, 2005 10:29 pm
by jaymoore_299
I'm looking to do all these, find out how many and where the surfers are coming from (domain-wise), determine which links they are clicking, and how they exit my page.

Posted: Fri May 13, 2005 12:32 am
by Roja
jaymoore_299 wrote:I'm looking to do all these, find out how many and where the surfers are coming from (domain-wise), determine which links they are clicking, and how they exit my page.
Please, PLEASE, read: http://www.analog.cx/docs/webworks.html

Among other things on that well written explanation of how the web works..
You can't tell how many visitors you've had.
You can't tell how many visits you've had.
You often can't tell where they entered your site, or where they found out about you from.
You can't follow a person's path through your site.
You can't tell how they left your site, or where they went next.
Basically, *everything* you want to do is not possible to do in any accurate fashion.

That said, there *are* things you *can* see, that are valuable and that relate to your goals, so read that page.