Change the error id generation in the error logger JS module so that it tries to return the same id for the same bug. Given that error reports are affected by browser type, version and language, this is unlikely to be doable in a perfect way, but try to come up with something that results in not too many error ids per actual bug and a very small chance of the same error id for different bugs.
This will probably involve some sort of hash based on some combination of error location (file, line and column) and message fields.