Custom variables with different values appearing under the same value in dashboard

I’m attempting to log Javascript errors as custom variables. Here is my code:


 window.onerror = function(message, file, line) { 
  var sFormattedMessage = '[' + file + ' (' + line + ')] ' + message;
  sFormattedMessage = sFormattedMessage.substring(0, 200);
  _paq.push(['setCustomVariable',  1, "JS Error", sFormattedMessage, "visit"]);
 }

I expect each unique exception value to be a separate group with a count. Instead, when I try triggering different exceptions with different variable values, they show up under the first exception that was triggered. So no matter what exception message is used, they all get grouped under one exception name.

Log the custom variables as scope “page”