Wie fügt man eine Metrik hinzu?

Hier ist mein Button

    buttons.push(this.attach('button', {
      label: 'log_in',
      className: 'btn-primary login-button',
      action: 'showLogin'
    }));

Wie füge ich diesen Code hinzu?

.setAttribute('onclick', "ym(XXXXXXXX, 'reachGoal', 'login_button'); return true;")

Dies sollte im Quellcode zu finden sein