online user count

T

Tahir

Hi,
i have a problem with my online user count;

void Session_Start(object sender, EventArgs e)
{...
System.Web.HttpBrowserCapabilities tarayici = Request.Browser;
if (tarayici.Crawler)
return;
Application.Lock();
Application["ActiveUsers"] =
Convert.ToInt32(Application["ActiveUsers"]) + 1;
Application.UnLock();
....}

the Application["ActiveUsers"] shows the hit about 100.
then i log the request ip and some other information like date to my sql.
so it is clear that all the hit is made bu Google, Yahoo and some other
search engines.

what can i do to count only the human visiters but not the bots?

thanks
 
G

George

Probably the best way to count Browsers and not crawlers is to embed a
transparent image into your pages.
And count hit as a user only if this image is beign hit by browser.

So somehting like this.

------Anypage.aspx--------
if( Sesssion["count"] == null )
Sesssion["count"] = 1;
......
<img src="/userCounter.aspx">

------userCounter.aspx--------

if ((Session["count"] != null) && (Session["count"] == 1))
{
Application["ActiveUsers"] =
Convert.ToInt32(Application["ActiveUsers"]) + 1;
Session["count"] = 2;
}


So the idea is to first make sure that user requested the aspx page and then
requested an image. Thus eliminating BOTs that hit pages as well as bots
that hit images.


George.
 
L

Larry Bud

Hi,
i have a problem with my online user count;

void Session_Start(object sender, EventArgs e)
{...
        System.Web.HttpBrowserCapabilities tarayici = Request.Browser;
        if (tarayici.Crawler)
            return;
        Application.Lock();
        Application["ActiveUsers"] =
Convert.ToInt32(Application["ActiveUsers"]) + 1;
        Application.UnLock();
...}

the Application["ActiveUsers"] shows the hit about 100.
then i log the request ip and some other information like date to my sql.
so it is clear that all the hit is made bu Google, Yahoo and some other
search engines.

what can i do to count only the human visiters but not the bots?


Require a login to access your site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top