1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Click Counter

Discussion in 'Programming' started by nlgordaz, Sep 5, 2005.

  1. #1
    Does anyone know of something that would count the number of clicks a banner gets on a website?
     
    nlgordaz, Sep 5, 2005 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    By posting it in the SEO forum, are you implying you want an SEO friendly click counter? That doesn't exist. At least not if you want it accurate.
     
    T0PS3O, Sep 5, 2005 IP
  3. nlgordaz

    nlgordaz Peon

    Messages:
    138
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm looking for anything SEO friendly or not.
     
    nlgordaz, Sep 5, 2005 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OK, then you posted it in the wrong forum. I'll move it to programming. Any specific platform you want? PHP can count it but not SEO friendly. Same with Javascript or ASP etc. Just use a redirect and update the count just before you send the document headers. There will be plenty of code examples on hotscripts.com.
     
    T0PS3O, Sep 5, 2005 IP
  5. nlgordaz

    nlgordaz Peon

    Messages:
    138
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK, that sounds good. Could you give me the link to the thread. Thank you. Could you explain this a bit further, "ust use a redirect and update the count just before you send the document headers."
     
    nlgordaz, Sep 5, 2005 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just browse there, it's in Programming.

    It works like this. Your link has an id. You pass the id to the counter. The counter logs a click for that id. Then the counter forwards it to the landing page.

    Very simplictically your database table looks like this:

    |id|target_url|count|
    |1|http://www.microsoft.com|10|
    You link to microsoft like this:

    "Download IE from <a href="clickcount.php?id=1">Microsoft</a>"

    In clickcount.php you have:

    $landing_url = SELECT target_url from click_table WHERE id = $_GET['id'];

    $log_click = UPDATE click_table SET count = (count +1);

    header location:$landing_url

    Disclaimer: the above doesn't work, just schematically drawn structure of it all.
     
    T0PS3O, Sep 5, 2005 IP
  7. SharkSpace

    SharkSpace Peon

    Messages:
    431
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I think you would be better off getting an add management system. There are some really good free ones. It would make tracking your stats much easier.
     
    SharkSpace, Sep 8, 2005 IP
  8. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You can do it an SEO-friendly way by using 301 redirects in the PHP header() call, rather than the default 302.
    Most SE's these days seem to pick up on 301 redirects ( eventually ) and assign the benefit of the links accordingly
     
    johnt, Sep 8, 2005 IP