Get unique, static id from a device via web request

I have an MVC application that I would like to add some custom stats to. For some of the stats, it would be nice to have a unique identifier for a device.

For example, if I have a unique id for a RSS subscriber, I can monitor the active number of RSS subscribers.

I was wondering if anyone knew of anything in the web request that could be used as an ID other than the IP (which can obviously change). Something like a device ID or something?




Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Here are some approaches to consider.

HTTP Headers

There are a few HTTP Headers you can look at that can help you identify a unique user or device – some would refer to the sim card, some refer to the device.
Here is a list that I derived from the headers that Google Adsense Mobile uses to help track their advertising:

  • x-dcmguid
  • x-up-subno
  • x-jphone-uid
  • x-em-uid

These are probably some very popular one’s, but there would be more vendor/device specific headers that are popular. You could start gathering all the headers your site receives and count how many of each you receive and start building up your own database of common headers.

Some other approaches


Cookies is something that can be set on the requesting agent (browser for example) and returned when the agent visits again. For a list of methods, check out Ever Cookie – the virtually permanent cookie – it works by using one of the following methods of which at least one will work:

 - Standard HTTP Cookies 
 - Local Shared Objects (Flash Cookies)
 - Silverlight Isolated Storage 
 - Storing cookies in RGB values of auto-generated, force-cached 
    PNGs using HTML5 Canvas tag to read pixels (cookies) back out
 - Storing cookies in Web History 
 - Storing cookies in HTTP ETags 
 - Storing cookies in Web cache 
 - caching
 - Internet Explorer userData storage
 - HTML5 Session Storage 
 - HTML5 Local Storage 
 - HTML5 Global Storage 
 - HTML5 Database Storage via SQLite


It’s also possible to come up with your own scheme, e.g. take the user-agent header, some other headers like accept, x-fowarded-for and the ip make a unique hash value of out them to more accurately determine the uniqueness of the agent.

There are many different mobile headers as seen here. I also hit a page of mine and store mobile headers from various devices for my own purposes here (also ua1.txt, ua2.txt etc)

Method 2

The short answer is their isn’t any (and with good reason given privacy concerns). The more helpful answer would be that this is something you would normally do using cookies. You set a cookie and then check that to identify the specific browser making the request.

Of course, this is by no means fool-proof as users can reject cookies, delete them and they can use many different browsers (each of which will have a different cookie). If you are being devious (and I wouldn’t recommend this) you could use a Local Shared Object (Flash Cookie) as this is less likely to be removed. At the end of the day, though, if someone doesn’t want to be tracked you can’t force them to be.

Generally, though, if you want analytics and tracking then consider using a 3rd party solution like Google Analytics. This will give you very detailed data (albeit still relying on cookies and javascript) about your visitors and their browsing habits.

Method 3

other than the IP

If your site doesn’t require any sort of authentication in order to serve this content, the IP address is the only thing you could get to identify clients, and even this might not be unique, for example you could have two clients behind the same proxy => no way of distinguishing those requests in this case. Another possibility is to use cookies, but that sort of falls in the first category => authentication.

Method 4

There is no identifier that’s provided by a browser, privacy concerns make it very unlikely that any vendor would ever implement that, now at least.

The only option you have is some form of cookie.

For RSS feeds, you could conceivably embed a random unique ID in the feed URL every time its rendered, so you’d know when the person that retrieved that URL downloaded your feed. However, if the user shared that URL with others you’d have no real way of knowing.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x