{"action":"opened","issue":{"url":"https://api.github.com/repos/divolte/divolte-collector/issues/92","labels_url":"https://api.github.com/repos/divolte/divolte-collector/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/divolte/divolte-collector/issues/92/comments","events_url":"https://api.github.com/repos/divolte/divolte-collector/issues/92/events","html_url":"https://github.com/divolte/divolte-collector/issues/92","id":71314719,"number":92,"title":"Support user defined parameter without any custom event","user":{"login":"BHMath","id":6143089,"avatar_url":"https://avatars.githubusercontent.com/u/6143089?v=3","gravatar_id":"","url":"https://api.github.com/users/BHMath","html_url":"https://github.com/BHMath","followers_url":"https://api.github.com/users/BHMath/followers","following_url":"https://api.github.com/users/BHMath/following{/other_user}","gists_url":"https://api.github.com/users/BHMath/gists{/gist_id}","starred_url":"https://api.github.com/users/BHMath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BHMath/subscriptions","organizations_url":"https://api.github.com/users/BHMath/orgs","repos_url":"https://api.github.com/users/BHMath/repos","events_url":"https://api.github.com/users/BHMath/events{/privacy}","received_events_url":"https://api.github.com/users/BHMath/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-27T15:18:05Z","updated_at":"2015-04-27T15:18:05Z","closed_at":null,"body":"I notice in Piwik that it was possible to set a parameter like userId on every page without firing any event.\r\n\r\nIs it possible to add something like this to divolte.\r\n\r\nI manage to do a workaround for now but divolte stores both the pageView event and my customEvent.\r\n\r\nHere my workaround : \r\n```javascript\r\n<script src=\"//localhost:8290/divolte.js\" async defer onload=\"fireDivolteEvent();\"></script>\r\n<script type=\"text/javascript\">\r\nfunction fireDivolteEvent(eventName, params) {\r\n\t// Set a default eventName if none provided\r\n\teventName = (!eventName) ? 'displayPage' : eventName;\r\n\t// Create a default param oject to set the userId\r\n\tparams = (!params) ? {} : params;\r\n\t// Define the user id if it's not done already\r\n\tparams.userId = (!params.userId) ? getUserIdFromMyApp() : params.userId;\r\n\t// Add all page defined params if exists\r\n\tif (typeof divolteParams !== 'undefined') {\r\n\t\t$.extend(params, divolteParams);\r\n\t}\r\n\t//Fire the event in Divolte\r\n\tdivolte.signal(eventName, params);\r\n}\r\n</script>\r\n```\r\n\r\nI suggest to modify lines 949 and 955 of divolte.js to `signal('pageView', divolteParams);`\r\n\r\nAnd then in my webapp i could do this\r\n```javascript\r\n<script type=\"text/javascript\">var divolteParams = { p1: 'v1',  p2: 'v2'};</script>\r\n<script src=\"//localhost:8290/divolte.js\" async defer\"></script>\r\n```\r\nAccording to this, i can always pass user defined parameter on my own like my own userId or whatever I need to track.\r\n\r\nObviously some check must be done before applying this parameters.\r\n"}}