How to count how many times a link is clicked

14 replies
Hi Everyone,

I'm just starting to get my act together promoting an affiliate offer at Maskers For Tinnitus and I want to figure out how to optimize my page so I can get more people to click through to my vendors web site.

I am currently using a single PHP redirect file as the link to send people to the Vendors page but I need a way to count how often the redirect link is used, or ideally what percentage of visitors click the link.

I also need a way to reset that count to zero so that when I make a change to the page I can start over and get fresh numbers.

Does anyone have any suggestions?

Thanks a bunch!

- Pete
#clicked #count #link #times
  • Profile picture of the author XoC
    Pete,

    There's probably a few things out there on Hot-scripts but Google actually has a really good tool for this - googlecom/websiteoptimizer
    {{ DiscussionBoard.errors[4012810].message }}
  • Profile picture of the author ussher
    before you send them off to the url via the redirect, log the incoming details into a mysql table.

    if you want to build it yourself.

    I use Adtrackz to do the same thing.
    Signature

    "Jamroom is a Profile Centric CMS system suitable as a development framework for building entire communities. Highly modular in concept. Suitable for enterprise level development teams or solo freelancers."

    - jamroom.net
    Download Jamroom free: Download
    {{ DiscussionBoard.errors[4012933].message }}
    • Profile picture of the author TinPete
      Thanks guys... didn't know stuff like that even existed!

      I'll be sure and check them out.
      Signature

      Interested in Psychic Development? You've never seen anything like Miracle Mastery. Take a look!

      {{ DiscussionBoard.errors[4015763].message }}
  • Profile picture of the author hhunt
    These are some of the things I've developed to monitor my sites. Although there are some tools out there for this sort of tasks, I wanted to take control of how it works - and besides, wanted to spend my weekend programming.

    That said, log all clicks in a simple database table, increment it on every click. Have a method that shows you total value saved.

    If you are struggling and need custom script written for you, then post here.

    Good luck
    {{ DiscussionBoard.errors[4020297].message }}
    • Profile picture of the author st8ic
      If you don't want to be bothered with creating an SQL table, do this:

      1. Make a text file called "count.txt" containing the number 0 in the same directory as your redirect script.

      2. Before the redirect, insert this:

      <?php
      $fp = fopen("count.txt", "r");
      $count = fread($fp, 1024);
      fclose($fp);
      $count++;
      $fp = fopen("count.txt", "w");
      fwrite($fp, $count);
      fclose($fp);
      ?>

      (sorry I can't use code tags, this forum is retarded and it strips terms with a dollar sign)

      3. To reset your counter, open the text file and set it back to 0.
      {{ DiscussionBoard.errors[4022880].message }}
      • Profile picture of the author rixlo
        Originally Posted by st8ic View Post

        If you don't want to be bothered with creating an SQL table, do this:
        .
        I'm a newbie. Learing a lot. I do appreciate the community forum
        ric
        Signature
        "Humpty Dumpty was pushed"
        {{ DiscussionBoard.errors[4032128].message }}
      • Profile picture of the author Johnletton
        Originally Posted by st8ic View Post

        If you don't want to be bothered with creating an SQL table, do this:

        1. Make a text file called "count.txt" containing the number 0 in the same directory as your redirect script.

        2. Before the redirect, insert this:

        <?php
        = fopen("count.txt", "r");
        = fread(, 1024);
        fclose();
        ++;
        = fopen("count.txt", "w");
        fwrite(, );
        fclose();
        ?>

        (sorry I can't use code tags, this forum is retarded and it strips terms with a dollar sign)

        3. To reset your counter, open the text file and set it back to 0.
        I agree with you the way discussed it truly beautiful.
        {{ DiscussionBoard.errors[4058885].message }}
  • Profile picture of the author TinPete
    Thanks everyone,

    Those are great tips, and it sounds like they do exactly what I am looking for. I'll start playing with them right away!
    Signature

    Interested in Psychic Development? You've never seen anything like Miracle Mastery. Take a look!

    {{ DiscussionBoard.errors[4042791].message }}
  • Profile picture of the author ionisis
    Use php mysql to store the traffic AND clicks. Use the url as the primary key (for simplicity). Reset count to 0 after editing the page/link, manually or via a script. Store the Date along with the data, so you can compile reports, if you wish, and so you can isolate changes, and their effects.
    {{ DiscussionBoard.errors[4057729].message }}
  • Profile picture of the author yangyang
    I wrote an article about how to count the number of times a file has been downloaded or the number of times a file is accessed: Simplest PHP Hit Counter or Download Counter &ndash; Count the Number of Times of Access (Page Views or File Downloads)

    You can easily modify the script to count the number of times a specific URL has been accessed / clicked.
    Signature

    1. Global Movies Database = $489.95 = 1.5 GB data + 65.9 GB images.

    2. World Hotels Database = $589.95 = 1.54 GB data + 71.4 GB images.

    3. Auto Parts Database = $489.95 = 15.8 GB data + 30.4 GB images.

    {{ DiscussionBoard.errors[4058416].message }}
  • Profile picture of the author LorrieJean
    I noticed your using wp~ I like pretty links for affiliate links and sometimes internal links too~ If you use the link description feature it's simple to see how many clicks are going where.

    Great Thread and awesome PHP Thanks to @st8ic
    {{ DiscussionBoard.errors[4072814].message }}
  • Profile picture of the author danieljames123
    Hey"radhika" I checked it and I think it is best way for check that how many times clicked our sites.
    {{ DiscussionBoard.errors[4086881].message }}

Trending Topics