Well, as the trace is present upon an underage Wizard before he comes of age, hence the Ministry being able to detect underage magic immediately whenever the underage Wizard does it, I still don't quite understand the following situations.
(Is it traceable by location or by person?)
When Dobby did the Hover Charm (Year 2), the Ministry couldn't differentiate whether it was indeed Dobby or Harry Potter who performed it. Suggesting the Ministry detect some kind of magic at a particular address they have on record as being resident to an underage wizard?
However, when Arthur Weasley visited Harry Potter at Privet Drive (Year 4), he did a lot of magic, including magically dodging the teacups Mr. Dursley was throwing as him, and as well as performing an anti-Engorgment charm to return Dudley's tongue to a normal size. So how come did the Ministry differentiate who actually performed magic?
Moreover, at The Burrow, what happens if an underage Harry or Ron performs magic? Can't simply the elders say they performed magic instead?
Update: After reading two answers below I'm still confused. If magic is location based, Tonks, Madeye and Dumbledore all do a lot of magic at Privet Drive and Harry is never caught. Additionally, can't Harry do magic at The Burrow and Mrs. Weasley simply say she did it instead. Whereas if Magic is person based, obviously it isn't because they could differentiate that Dobby performed the magic and not Harry.