You are here: Re: Recording clicks in a webpage « All PHP « IT news, forums, messages
Re: Recording clicks in a webpage

Posted by zach on 06/02/07 07:02

> Beucause i need to calculate the ranking of each link... something
> digg.com`ish.... so i need to know when a user clicks on something.
>

Analytics has the option to add a piece of code to each link and when
clicked it tracks how many times its been clicked and of course all the
other good information that comes with analytics.

Heres the code,

onClick="javascript:urchinTracker('/outgoing/ebay_com');"

You can name these whatever you want and group them how you want like this:

onClick="javascript:urchinTracker('/electronic/anylink_here');"
onClick="javascript:urchinTracker('/electronic/craigslist_org');"
onClick="javascript:urchinTracker('/electronic/ebay_com');"

onClick="javascript:urchinTracker('/another_category/something_else_net');"
onClick="javascript:urchinTracker('/another_category/something_else_org');"
onClick="javascript:urchinTracker('/another_category/something_else_com');"


Of course each of the pieces of code above would be placed in each link.
For example, if you have a link to ebay you would use it like:

<a href="http://ebay.com"
onClick="javascript:urchinTracker('/electronic/ebay_com');" >check out
ebay</a>

It will appear in your Analytics content sections just like any other
page but you can then sort them using filters: Hers what it will look like:
Pageviews Unique Pageviews
/outgoing/ebay_com 13 11


However there are some benefits to storing it in a mysql database such
as the option to sort links each time a page is loaded based on the
popularity of each link or display the number of clicks each link has
had. However I'm new to php so I'm not exactly sure how to do this.

Hope this helps.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация