asalhani asalhani - 1 month ago 9
ASP.NET (C#) Question

Identify if request is coming from local network (intranet)

I need to identify if a request comes from Internet or Intranet using either client-side or server-side.

The problem I'm trying to solve is: our web site can be accessed from internet and intranet. The intranet user (user inside company), does not have access to internet. We are using Google Anylitics, when intranet user access the page, the page take so long to upload because it tries to download (ga) JavaScript file generated from Google.

Any solution?

Answer

You can check the ip address of a user. Private ip4 address always start with either 10., or 172., or 192.* ... more info on private networks here.

You can also make Google Analytics load Asynchronous.

Comments