function countEvent(e) {
  const type = e.type;
  const target = e.target;

  if (!events[target]) {
    events[target] = {};
  }

  if (events[target][type]) {
    events[target][type]++;
  } else {
    events[target][type] = 1;
  }
}
Increments the global counter for events of this type.
@param {googEvents.Event} e Event to count.