website hit counter (for each page)

Topics: Developer Forum, User Forum
Jan 30, 2008 at 6:21 AM
First, I am new to building a website, but using this My Web Pages Starter Kit, I was able to get it going in about 1 day and then another 2 or 3 to build additional pages, etc. I am very impressed, to say nothing of the people I built this for!!!! If you are interested, the website is http://www.newmansmithorchestra.org/

So now they have asked for a hit counter for each page of the website so that they can see what pages are of interest, etc. I though maybe to add some code to the footer and that didn't seem to work. I next tried to create a new easy control and then stick some ASP sample code I found (http://www.asp101.com/samples/counter.asp?images=False) into it. I also can't get that to work either.

So, at this point, I have two request. First, please consider a configurable page hit counter in a future release of the starter kit. Something that could be switched on/off in the CMS setup admin page.

Next, are there any examples of a hit counter integrated with this starter kit that anyone has done? Or is this easy to do and I just don't know how?

Thanks for any help.
Jan 31, 2008 at 4:34 AM
Google Analytics. Free.. easy, and you get so much more than just page counters. :-)
May 27, 2008 at 12:35 AM


aeromed wrote:
Google Analytics. Free.. easy, and you get so much more than just page counters. :-)



What is the best way to add the code for Google Analytics to "My Web Pages Starter Kit"?
May 27, 2008 at 8:00 PM
I second aeromed.  Google analytics is great.

Not sure if this is the best way to do it, but I added the analytics script to the site.master file, just above the </body> tag, and that was it.
May 27, 2008 at 9:02 PM
Edited May 27, 2008 at 9:22 PM


Not sure if this is the best way to do it, but I added the analytics script to the site.master file, just above the </body> tag, and that was it.

Thats the spot. 

If you want to keep the script data in app_data, rather than hardcode in the skin file (in case of multiple sites, etc), you can create/add a GoogleScripts.cs control and configure it thru admin/website.aspx.

(If one's not sure how to do this.. take the "cc1:WebsiteTitle" control, "follow" and study how/where  it's set,.. get in website.aspx.cs... look at the websitetitle.cs in app_code/controls, string property in website.cs.. etc.   All that as example should be of great help!)