willi wusel has asked for the wisdom of the Perl Monks concerning the following question:

I have a couple of affiliate sites. So I need to track users who come from these sites and are going to our shop. Up to now I am doing this with cookies, as IP information uses to get aliased by NAT.

Now I thought in order to track the users it might be possible to extract the internal IP from the incoming packet header having a rather unique external/internal IP pair. This would allow me to dispose of the unwanted cookies.

So I would need a simple HTTP server (just serving images) which traces the received packages peeling out the internal/external IP information.

Anybody has an idea?

  • Comment on Trace HTTP users by NAT header information

Replies are listed 'Best First'.
Re: Trace HTTP users by NAT header information
by adrianh (Chancellor) on Dec 02, 2002 at 11:47 UTC

    Unfortunatly relying on IPs isn't going to work. Proxies and related technology mean that you cannot reliably map IP addresses to individuals. Multiple users can come from a single IP, and a single user can come from multiple IPs.

    I'd stick with the cookies :-)

Re: Trace HTTP users by NAT header information
by tachyon (Chancellor) on Dec 02, 2002 at 12:26 UTC

    extract the internal IP from the incoming packet header

    The internal IP is not sent in the header, only the external IP of the NAT box is. Only the NAT box knows the internal IP. The NAT box knows which internal client to direct any given packets to becuse it remembers the PORT (not IP) that it negotiated for that client transaction.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Trace HTTP users by NAT header information
by Ryszard (Priest) on Dec 02, 2002 at 12:14 UTC
    If you've got a shop, presumably you have users log in before sending off orders.. ?

    Again, there is no reliable way of doing this, as what you're doing with a cookie is tracking a browser, not a user (unless you get them to log in 1st, in which case, you can build statistics from your session data server side...)

Re: Trace HTTP users by NAT header information
by valdez (Monsignor) on Dec 02, 2002 at 13:03 UTC

    I think that neither cookies nor images will work in all situations, given that 'modern' browsers allow to disable them when not originating from the web site you are looking at.

    A possible solution is to pass a ticket from your affiliates to your site and/or provide a dedicated entry point, that will log the referee and then forward the request to real page.

    Ciao, Valerio