Page view count
A very common question How to count page visits to my site?
Well, it can be done in many ways. Here, I will shade some lights on simple and better approch.
Using ASp.net server side code.
When browser begins the request, OnBeginRequest event you can count the page views againt that requet.
What if the request is coming from Load Testing tool or any robot? It is simple approch but not good.
It doesn't ensure that the request is coming from browser.
Many people think to use OnbeginRequest event. This way you will count unnecessory stuff like request to css file or javascript file or image content
Better approch:
Create a javascript which will execute at client side browser. Once it start requesting the server apply your logi to count the page visit.
This ensures that the request is coming from Browser as script engine inside the browser is making call.
You can see Google analytics and other tools who can be used to tracks the traffice on your site uses JavaScript.
If you planned to create your own, the benifit is you can have this module of tracking something out of box.
Satalaj
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
Tags: