SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Trondheim, Norway
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    counting clicks on a link

    Hi

    I've developed an ad system for a internet portal, and I was just wondering what the best way of count clicks on a banner is.

    I'm currently using this method:
    the ad-link points to a php file called linkref.php
    so an example link would be: linkref.php?adid=555

    the script then increments the number of clicks in the database on the current link and then echo's this line:
    PHP Code:
    header("Location: " $url); 
    ($url beeing the url for adid 555, of course

    But I'm wondering if this method is any good, some people has complained that the link dosn't work, and the hits dosn't show up on the target site stats (Awstats).


    So to sum this up, is my method any good, and what other good method's are there for this job?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That method is fine, make sure the url is full: http://www etc

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The link may not work if you are using an IIS based server AND setting cookies on the linkref.php page. If so, then repleace the header() with a HTML meta-redirect. Otherwise, you method is fine and exactly what i use and i don't have problems.

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Trondheim, Norway
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your input. I think the linkproblem is with flash and not the header() method.
    Do you have any thoughts about this?
    Are there any version problems with flash ads?

    I use the following method for flash ads:
    in the flash movie, i have a big button whitch covers the entire movie with the following action:

    on (release) {
    getURL(clickTAG, "_blank");
    }

    the clickTAG variable is ofcourse the link passed throug the html code:
    ....
    <param name='movie' value='../annonser/flash/annonse_14.swf?clickTAG=linkref.php?id=14'>
    .....


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
  •