locked
custom analytics RRS feed

  • Question

  • User1865475573 posted

    I want to make myself a statistical software like google analytics and I want to receive information from the visitors, but the IP address has changed, if a visitor comes to the site again, I recognize how these visitors. Can I get a unique information such as MAC address 

    Tuesday, August 13, 2013 3:30 AM

Answers

  • User-1910946339 posted

    You can't get the MAC address of the remote machine, as far as I know.  If the user is behind a proxy (like most large companies) then the IP address will be of the proxy server which is shared by many users, so the IP address doesn't uniquely identifier the visitor either.  Remote address plus port number is closer to what you want but I imagine that port numbers change when you are behind a proxy server as well.

    The MAC address doesn't give you unique visitors either, many people share a single physical computer and so share a MAC address.

    The previous post will give you the MAC address of the first network card on the web server which is not very useful for identifiying visitors!

    As far as I know the only way to determine if it is a returning visitor is if you are allowed to store a cookie on their computer.  You could store a unique value (a guid would be a good choice) in a cookie and store the same value in your database.  If a visitor already has a cookie and the value is in our database then they are a returning visitor.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 13, 2013 4:01 AM

All replies

  • User-306750178 posted

    Hi,

    Yes you can get MAC address to recognize visitor.

    Look into the sample code in C#.NETto get MAC address.

    public string GetMACAddress()
    {
        ManagementObjectSearcher objMOS = new ManagementObjectSearcher("Win32_NetworkAdapterConfiguration");
        ManagementObjectCollection objMOC = objMOS.Get();
        string MACAddress = String.Empty;
        foreach (ManagementObject objMO in objMOC)
        {
            if (MACAddress == String.Empty) // only return MAC Address from first card   
            {
                MACAddress = objMO["MacAddress"].ToString();
            }
            objMO.Dispose();
        }
        MACAddress = MACAddress.Replace(":", "");
        return MACAddress;
    }



    Tuesday, August 13, 2013 3:40 AM
  • User1865475573 posted

    Thanks for your ansver.I will try your code sample ;)

    Tuesday, August 13, 2013 3:53 AM
  • User-1910946339 posted

    You can't get the MAC address of the remote machine, as far as I know.  If the user is behind a proxy (like most large companies) then the IP address will be of the proxy server which is shared by many users, so the IP address doesn't uniquely identifier the visitor either.  Remote address plus port number is closer to what you want but I imagine that port numbers change when you are behind a proxy server as well.

    The MAC address doesn't give you unique visitors either, many people share a single physical computer and so share a MAC address.

    The previous post will give you the MAC address of the first network card on the web server which is not very useful for identifiying visitors!

    As far as I know the only way to determine if it is a returning visitor is if you are allowed to store a cookie on their computer.  You could store a unique value (a guid would be a good choice) in a cookie and store the same value in your database.  If a visitor already has a cookie and the value is in our database then they are a returning visitor.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 13, 2013 4:01 AM
  • User1865475573 posted

    i think this is better idea,thanks paul.

    Tuesday, August 13, 2013 5:35 AM