Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am developing my own blog site in ASP.NET and I would have several blogs in future. I want to have a widget on page which will show the number of user visited to my page based on the URL {Because for every every blog I will a unique URL}, so that the new user could know that the blog has been visited how many times!

I can make the same via coding, very easily, but I have database size restriction from my hosting provider and I can't go beyond that !!

Please assist !

share|improve this question
1  
Are you trying to count visits to an individual page, or to the website in total? –  Ciaran Apr 8 '11 at 6:54
    
@Ciaran Yes, for each page !! –  Chris Apr 11 '11 at 6:04
add comment

1 Answer

up vote 2 down vote accepted

I think the easiest way to achieve this would be to increase the database size from your hosting advisor. However, you can do it using Google Analytics as your data store.

Using the Google Analytics API to retrieve page views

  1. add the Google Analytics tracking script to your website
  2. Use the Data Export API to authenticate with Google, which will allow you to query for your analytics. Get started here: http://code.google.com/apis/analytics/docs/gdata/gdataDeveloperGuide.html
  3. using the Data Feed Query Explorer, construct a query that returns the number of page views to a given page. You can filter using the ga:pagePath dimension. AN example query is given below.
  4. Put it altogether to create an embeddable script that takes the current page as a parameter and passes it to the Data Feed Query

Data Feed Query Explorer Example

This example returns the Page Path and Page Views for the home page - "/". You will have to supply your own Google Analytics Table ID (e.g. ga:123456)

https://www.google.com/analytics/feeds/data?
    ids=[your-GA-profile]&
    dimensions=ga%3ApagePath&
    metrics=ga%3Apageviews&
    filters=ga%3ApagePath%3D%3D%2F&
    start-date=2011-04-08&
    end-date=2011-04-08&        
    max-results=10
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.