In academic (computer science) circles this is known as affective computing (link to Wikipedia article).
From a computer science perspective, the challenge is first to characterise the user's behaviour/emotion while they are experiencing/using the system, and then classify this feature vector (a list of numbers describing the behaviour) to belong to a specific class (emotion/state). This can go all the way from capturing input (mouse/keyboard) to facial feature recognition, speech recognition etc.
A simplistic example: While attempting to complete the check-out process on our e-commerce site, the user clicked 30 times in quick succession (under 20 seconds). From our existing (training) data, frustrated users frequently exhibit this high frequency of clicks. If we only consider this single metric, we can reasonably assume that this user was frustrated too.
Another growing study field is "emotion in games". Specifically, attempting to measure the engagement and frustration/enjoyment of a player, and thereby automatically tuning the game's difficulty (artificial intelligence playing strength) to result in a more enjoyable experience. There is a lot of interesting reading material there (search for "IEEE computational intelligence emotion in games"), but I'm not sure if you want to implement something like this yourself, or if you want an existing off-the-shelf solution.