SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict betrollwin.com's Avatar
    Join Date
    Nov 2005
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Referrer Tracking (JS/PHP)

    I have code
    Code:
    <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">document.write('<a href="http://mysite.com" target="_blank" title="my site"><img src="http://mysite.com/track.php?id=1&ref=' + document.referrer + '" border="0" alt="my site" /></a>');</SCRIPT>
    When the referrer is a search engine query like:
    http://www.google.com/search?hl=en&q...=Google+Search

    only the
    http://www.google.com/search?hl=en get recorded

    How do I get the rest of the code?
    Last edited by betrollwin.com; Sep 1, 2007 at 16:46.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    referrer

    IMHO it would be best to do the referrer tracking from the "TheirPage1.html" site using server-side code. But even then HTTP referer is not 100&#37; reliable. What kind of server-side script is possible on the site?

  3. #3
    SitePoint Addict betrollwin.com's Avatar
    Join Date
    Nov 2005
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look at OP - new problem
    Last edited by betrollwin.com; Sep 1, 2007 at 16:46.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    query string

    window.location.search


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •