-5

In my application, I want to keep track of number of visitors. I am using Visual Studion 2008 and SQL Server 2005.

Thanks, Archana

archana roy
  • 1,147
  • 3
  • 11
  • 11
  • Wat is lol? Any code language?...do u know the answer to my question? – archana roy Sep 20 '09 at 15:28
  • Thanks ...but i don need your flowers. – archana roy Sep 20 '09 at 15:28
  • I want to capture 2 things in my web application-- 1. Total number of visitors till date 2. Number of visitors at a specific time It will be really good if u can tell me the logic. – archana roy Sep 20 '09 at 15:34
  • 1
    What exactly are you trying to accomplish? Number of visitors online at a specific moment; number of visitors that have accessed your site .. ? If you want to get answers, you need to give more details, and show that you care, instead of just asking for the code. – João Silva Sep 20 '09 at 15:35
  • 2
    @archana roy: Please keep it civil. – Colin Mackay Sep 20 '09 at 15:40
  • 1
    To implement a visitor counter, check this question: http://stackoverflow.com/questions/669049/implementing-a-visitor-counter. – João Silva Sep 20 '09 at 15:40
  • Thanks JG for the answer. But is there any other way than using the Global.asax file?? – archana roy Sep 20 '09 at 15:44
  • Ya Colin. I respect this forum. But I am in a fix, and I posted a question in the forum to get the issue resolved. I am not expecting flowers from Mr.New in Town – archana roy Sep 20 '09 at 15:45
  • Very smart Mr.MunkhiPhD. It will be really helpful,if you can provide me with the solution of my problem rather than commenting o unnecessary stuffs. – archana roy Sep 20 '09 at 15:49
  • 6
    @archana roy: Social conventions are very necessary "stuffs" if you want to get help. Imagine how easily you would get information from a standard SOAP based web service if you pass the request as a CSV. It won't work because you are not honouring the convention of how the information is to be passed. Human interaction is the same. Even although it allows for greater flexibility, there is a point where the communication eventually breaks down. By ignoring the way this site works and people interact on it, you are travelling fast to a break down. – Colin Mackay Sep 20 '09 at 15:58
  • @above.. nice analogy.. i wish it were a answer.. :) – sud03r Sep 20 '09 at 16:07
  • 3
    -1 for asking for code and such arrogant behaviour.. – sud03r Sep 20 '09 at 16:08
  • I got you Colin. But do you have an answer to my question. I would appreciate any help on the same. – archana roy Sep 20 '09 at 16:12
  • I saw in other questions,people providin the code.Hence i asked. It will be really helpful if a logic or concept to handle this is provided. – archana roy Sep 20 '09 at 16:15
  • 1
    @Archana - You will need to learn the rules of the game, before asking questions here... Don't get overwhelmed by the criticism just think of it like a learning experience... We all went through it ... Hope to seeing many more questions posted from you... – Kevin Boyd Sep 22 '09 at 03:49

3 Answers3

2

Try google analytics.

Novitzky
  • 4,756
  • 3
  • 23
  • 27
  • Hi Kamil. Thanks for your response. But I couldnt get your solution. How exactly can google analytics help me? – archana roy Sep 20 '09 at 15:39
  • Because it collects massive quantities of information about how your website is being used. Much more than you are asking for. All you need to do is to drop some javascript code (which Google will supply) into your page (or master page). I just wrote a blog post on some of the information it provides: http://blog.colinmackay.net/archive/2009/09/20/Technology-trends-through-Google-Analytics.aspx – Colin Mackay Sep 20 '09 at 15:43
  • I'm guessing your app is public and anyone can access it from web. As Matt said, go to google analitics, register and get the code you need (You will see what I am talking about). Then put you code to every page you want to track. You will see the stats for not only how many visitors you had but what OS/browser/resolution/etc. they use. – Novitzky Sep 20 '09 at 15:45
  • Actually I am making an application for the form I am working with. Its not hosted in interent.Its an internal applcation actually. Thats why I didnt understand as to how google analytics could help me. – archana roy Sep 20 '09 at 15:48
  • Google analytics can still work on internal sites, so long as it has an internet connection. – Colin Mackay Sep 20 '09 at 15:54
  • You didn't tell us what kind of app you have got, but you wrote MSSQL2005 and VS2008 insted which is not helpful at all. – Novitzky Sep 20 '09 at 20:38
  • Hi Kamil, I have a windows application. Thanks for all your help. But please can you explain me what is google analytics in detail? I have never used Google analytics and what are the advantages of using google analytics? I will await your help. Thanks in advance – archana roy Sep 21 '09 at 06:16
  • 1
    You mean it is not a web application. Windows Applications don't get "visitors", hence the confusion. – Colin Mackay Sep 21 '09 at 10:31
  • Your question is tagged ASP.NET so for me it is a web app :) – Novitzky Sep 21 '09 at 16:50
2

If you don't want to expend alot of effort, the super simple solution is to use google analytics: http://www.google.com/analytics. Go to that URL, sign upad it will literally "give you the code" in the form of javascript to place at the bottom of your page.

I run a high traffic online advertising platform that requires fine grained click stream analysis of terabytes of data and that involves alot more effort, but hopefully the google analytics solution will work for you.

Matt Wrock
  • 6,590
  • 29
  • 23
  • Hi Matt....Thanks for all your help. But please can you explain me what is google analytics in detail? I have never used Google analytics and what are the advantages of using google analytics? I will await your help. Thanks in advance. – archana roy Sep 21 '09 at 06:14
  • Google Analytics gives you a piece of javascript to place at the bottom of your pages. When people come to your site, google analytics is called through this javascript and records the request. Then you can go to your google analytics dashboard and view reports detailing all sorts of interesting metrics: requests per day, geographical details, etc. It literally takes only a few minutes to create a gogle analytics account and it is totally free. Go to the URL above and you can get more info and create an account. – Matt Wrock Sep 21 '09 at 08:02
1

What you could do is add some code to your Request_Start method (in global.asax.cs) that calls into your DAL passing the appropriate data to the database. I am of course assuming you have a properly designed and layered application.

Colin Mackay
  • 18,736
  • 7
  • 61
  • 88
  • Hi Colin, Is there any other way to record the number of hits in the application without using the global.asax?? It would be really good of you if you can help me on this. – archana roy Sep 21 '09 at 06:11
  • It seems that from another comment that you made this is not a web application. Therefore you won't have a global.asax file. Because the concept of a "visit" and "visitor" are quite well defined in a web application it is easy to do something there. However, in a windows application there is no such concept. So you will have to define the concept in detail. What do _you_ mean by "visisor"? – Colin Mackay Sep 21 '09 at 10:34