Enhance codeocean events with user agent and external-id if present

This commit is contained in:
Ralf Teusner
2016-09-27 17:56:16 +02:00
parent 31c4f4b608
commit d26a0fa6a4
2 changed files with 8 additions and 2 deletions

View File

@@ -363,10 +363,15 @@ var CodeOceanEditor = {
},
publishCodeOceanEvent: function (eventName, contextData) {
// enhance contextData hash with the user agent
contextData['user_agent'] = navigator.userAgent;
var payload = {
user: {
type: 'User',
uuid: $('#editor').data('user-id')
uuid: $('#editor').data('user-id'),
external_id: $('#editor').data('user-external-id')
},
verb: {
type: eventName