Friday, April 4, 2008

Page Hit Counter in SharePoint

You would have seen many sites displaying page hit counters. To display this in SharePoint page, insert the “Hit Counter” web component from SharePoint Designer.

Open your site or your sites Master page to insert this component. For the demonstration purpose, I’ve use my default.aspx to insert the “Hit Counter” component. Once the page is opened in SharePoint Designer, place the cursor where you want to insert the hit counter. Go to Insert --> Web Component.




Click on the Web Component, this will display the available web components. You can find different types of other components readily available.



Click on the Hit Counter component, this will display different counter styles. Select any one style from the list. I have selected the below marked style.



Click on “Finish”, this will open the below Hit Counter Properties window.



You can even create your own Hit Counter. Use “Reset counter to” to reset the counter from a given number. To display fixed number of digits use “Fixed number of digits” property. Click on “Ok”, the hit counter will be inserted to your page. The below code will be inserted in your page to display the counter.



Now, preview your page from SharePoint Designer / a Web browser. You can see the Hit Counter incremented for each hit.



You can see the Hit Counter increments for each hit.

5 comments:

Livros e Revistas said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Livros e Revistas, I hope you enjoy. The address is http://livros-e-revistas.blogspot.com. A hug.

K.D.Kadyan said...

Nice One!!!

its small but very usefull thing.

Thanks

Ted said...

I got the Hit Counter to work on pages where authentication is done, but I get the red "X" on a page that is set to anonymous. Anyone else encounter this? Thanks in advance! -Ted

啤啤 said...

I get the same problem as Ted.
The site open for all users requires users to login after inserting the hit counter from SharePoint Designer.

Amit said...

Hi

Can you please assist me in inserting this page hit counter on the page in SPD as i am having some issues.

Thanks
Amit