count clicks sent to an external link

10 replies
hi
is there any way i can count the clicks sent to an external link on my site? to see how much visitors i sent to that site . the link is a simple link with image .

thank you very much
#clicks #count #external #link
  • Profile picture of the author Mike Adams
    You can just look at your Google Analytics, it will tell you.
    Signature
    P.S. If you found my post useful, please click the "Thanks" button below...
    {{ DiscussionBoard.errors[2326561].message }}
    • Profile picture of the author gcornelisse
      If you need more in-house control, you can create a simple PHP script that redirects the link. You just link to the PHP script, the script logs the click where and how you want, and then redirects to the final URL destination.

      For example:

      <?php

      $count = intval(file_get_contents('/path/to/file'));

      $count++;

      file_put_contents('/path/to/file', $count);

      header('location: http://www.final-destination-here.com');
      exit();

      ?>

      Keep in mind that this will log everything....including spiders. Mike's suggestion will likely give you clicks by "real" people.
      {{ DiscussionBoard.errors[2327188].message }}
    • Profile picture of the author downloadvyp
      how will Google analytics tell me how much visitors i sent to a site ?
      there i can only see how much visitors i received

      Originally Posted by Mike Adams View Post

      You can just look at your Google Analytics, it will tell you.
      {{ DiscussionBoard.errors[2327761].message }}
  • Profile picture of the author downloadvyp
    @ gcornelisse thanks for the code . but where will the logs be stored? where will i see how many clicks ?
    {{ DiscussionBoard.errors[2327763].message }}
  • Profile picture of the author Mike Adams
    @downloadvyp I use the Ultimate Google Analytics plugin for WordPress and it has an option to track external links. If your site is in WordPress, you may want to give it a try.
    Signature
    P.S. If you found my post useful, please click the "Thanks" button below...
    {{ DiscussionBoard.errors[2328727].message }}
    • Profile picture of the author downloadvyp
      my site is in joomla . so i can't use it. thanks anyway

      Originally Posted by Mike Adams View Post

      @downloadvyp I use the Ultimate Google Analytics plugin for WordPress and it has an option to track external links. If your site is in WordPress, you may want to give it a try.
      {{ DiscussionBoard.errors[2328790].message }}
  • Profile picture of the author downloadvyp
    nobody ? please
    {{ DiscussionBoard.errors[2332223].message }}
  • Profile picture of the author johnnyN
    google is your friend
    google.com/support/analytics/bin/answer.py?hl=en&answer=55527
    {{ DiscussionBoard.errors[2336871].message }}
  • Profile picture of the author BMboyz
    I am also looking a solution for this ..

    but i m using Wordpress..

    i saw a few wordpress owner that use this features.. when we hover mouse to the link, it will says how many click for that link have been encountered..

    Anyone may help us?
    {{ DiscussionBoard.errors[2339463].message }}
  • Profile picture of the author mywebwork
    I think Gary gave you all the answer in post #3. You write a simple PHP script that essentially increments a counter and then redirects the user to the selected page.

    There are probably dozens or hundreds of ways to do this, he illustrated one of them. You could pipe the output to a text file that you could use as a log, or to a database table. You could also tag a timestamp and some additional information to each record.

    This could be done regardless of your platform, with WordPress or Joomla you could either write your own plugin/component or use one of the existing ones that let you run PHP code within your posts.

    You could also just upload a PHP file that you use to direct every link to along with a ($_GET) parameter containing the final link - that would be a generic solution that would work with any platform.

    Bill
    {{ DiscussionBoard.errors[2339546].message }}

Trending Topics