SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Belgium
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Count clicks to external site?

    Hey,Is it possible to count the clicks going to an external site without a fowarding url like count.php?id=782 ?
    Because I want to do link exchange but, unless it's hardcoded, it's useless.
    Maybe through javascript?
    I know you can count internal clicks with a session, but does hat also work for external? And how?

    Thanks!

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    To be honest, the only way you can count clicks is by passing through a forwarding url, or some javascript (which won't be very reliable).
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With or without JavaScript, clicks have to go through a local script first.

    With JavaScript you can "hide" your script, by calling it using XMLHttpRequest, and then redirecting user to the actual link.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Belgium
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What will the URL's look like when using javascript?
    Thanks for replies!

  5. #5
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The urls will be the same, you'll just need an onclick event, which will fire an XMLHttpRequest (AJAX) function. This will call a PHP page, which can then add the data to a database.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  6. #6
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Belgium
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds pretty good, even though it won't be 100% reliable.
    Do you have a link to a tutorial explaining the concept?

    Thanks!

  7. #7
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    http://www.glennjones.net/Post/805/AjaxLinkTracker.htm

    Just googled it, so Im not sure if it's reliable, but the content looks like it's what you're after.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  8. #8
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    SitePoint Addict
    Join Date
    Aug 2005
    Location
    Belgium
    Posts
    387
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arkinstall View Post
    http://www.glennjones.net/Post/805/AjaxLinkTracker.htm

    Just googled it, so Im not sure if it's reliable, but the content looks like it's what you're after.
    I found the same link on google, but thought it wasn't what I was looking for


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
  •