{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/comments/55691972","id":55691972,"diff_hunk":"@@ -1031,4 +1099,30 @@ define([\n   return FxAccountClient;\n });\n \n+var METRICS_CONTEXT_OPTIONS = {\n+  context: true,\n+  entrypoint: true,\n+  migration: true,\n+  service: true,\n+  utmCampaign: true,\n+  utmContent: true,\n+  utmMedium: true,\n+  utmSource: true,\n+  utmTerm: true\n+};\n+\n+function marshallMetricsContext (data) {\n+  var metricsContext = {\n+    flowId: data.flowId,\n+    flowBeginTime: data.flowBeginTime","path":"client/FxAccountClient.js","position":176,"original_position":176,"commit_id":"4449f3752301bbf9d9adde4eca17d479f8b12293","original_commit_id":"4449f3752301bbf9d9adde4eca17d479f8b12293","user":{"login":"vbudhram","id":1295288,"avatar_url":"https://avatars.githubusercontent.com/u/1295288?v=3","gravatar_id":"","url":"https://api.github.com/users/vbudhram","html_url":"https://github.com/vbudhram","followers_url":"https://api.github.com/users/vbudhram/followers","following_url":"https://api.github.com/users/vbudhram/following{/other_user}","gists_url":"https://api.github.com/users/vbudhram/gists{/gist_id}","starred_url":"https://api.github.com/users/vbudhram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbudhram/subscriptions","organizations_url":"https://api.github.com/users/vbudhram/orgs","repos_url":"https://api.github.com/users/vbudhram/repos","events_url":"https://api.github.com/users/vbudhram/events{/privacy}","received_events_url":"https://api.github.com/users/vbudhram/received_events","type":"User","site_admin":false},"body":"Would it make sense to do any validation on options being set?","created_at":"2016-03-10T15:06:49Z","updated_at":"2016-03-10T15:06:49Z","html_url":"https://github.com/mozilla/fxa-js-client/pull/187#discussion_r55691972","pull_request_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/comments/55691972"},"html":{"href":"https://github.com/mozilla/fxa-js-client/pull/187#discussion_r55691972"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187","id":62277422,"html_url":"https://github.com/mozilla/fxa-js-client/pull/187","diff_url":"https://github.com/mozilla/fxa-js-client/pull/187.diff","patch_url":"https://github.com/mozilla/fxa-js-client/pull/187.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/187","number":187,"state":"open","locked":false,"title":"feat(client): add optional metricsContext metadata","user":{"login":"philbooth","id":64367,"avatar_url":"https://avatars.githubusercontent.com/u/64367?v=3","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"This change is to enable https://github.com/mozilla/fxa-content-server/issues/3551, propagation of metrics context metadata to the auth server for [FxA-70](https://github.com/mozilla/fxa/tree/master/features/FxA-70-kpi-dashboards).\r\n\r\n~~Something I wasn't sure about: I call `Object.keys` and `Array.forEach` at one point, are they safe to use in this repo or does it need to be ES3-safe? Happy to replace them with an old-fashioned loop if necessary.~~\r\n\r\n**EDIT:** This PR is dependent on https://github.com/mozilla/fxa-auth-server/pull/1213, it can't be merged until that one is.","created_at":"2016-03-09T18:55:09Z","updated_at":"2016-03-10T15:06:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9432a5dca1ed94849e227fd51c02aed28f8faa1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/187/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-js-client/statuses/4449f3752301bbf9d9adde4eca17d479f8b12293","head":{"label":"mozilla:phil/fxa-70","ref":"phil/fxa-70","sha":"4449f3752301bbf9d9adde4eca17d479f8b12293","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":13972055,"name":"fxa-js-client","full_name":"mozilla/fxa-js-client","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa-js-client","description":"A web client that talks to the Firefox Accounts API server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-js-client","forks_url":"https://api.github.com/repos/mozilla/fxa-js-client/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-js-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-js-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-js-client/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-js-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-js-client/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-js-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-js-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-js-client/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-js-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-js-client/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-js-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-js-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-js-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-js-client/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-js-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-js-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-js-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-js-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-js-client/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-js-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-js-client/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-js-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-js-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-js-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-js-client/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-js-client/deployments","created_at":"2013-10-29T23:39:29Z","updated_at":"2016-02-15T21:15:23Z","pushed_at":"2016-03-10T10:27:47Z","git_url":"git://github.com/mozilla/fxa-js-client.git","ssh_url":"git@github.com:mozilla/fxa-js-client.git","clone_url":"https://github.com/mozilla/fxa-js-client.git","svn_url":"https://github.com/mozilla/fxa-js-client","homepage":"","size":1166,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":2,"forks":19,"open_issues":2,"watchers":22,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"9f4cda069f2e2be8365ba7aee3c7014731390604","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":13972055,"name":"fxa-js-client","full_name":"mozilla/fxa-js-client","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa-js-client","description":"A web client that talks to the Firefox Accounts API server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-js-client","forks_url":"https://api.github.com/repos/mozilla/fxa-js-client/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-js-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-js-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-js-client/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-js-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-js-client/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-js-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-js-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-js-client/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-js-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-js-client/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-js-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-js-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-js-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-js-client/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-js-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-js-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-js-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-js-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-js-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-js-client/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-js-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-js-client/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-js-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-js-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-js-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-js-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-js-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-js-client/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-js-client/deployments","created_at":"2013-10-29T23:39:29Z","updated_at":"2016-02-15T21:15:23Z","pushed_at":"2016-03-10T10:27:47Z","git_url":"git://github.com/mozilla/fxa-js-client.git","ssh_url":"git@github.com:mozilla/fxa-js-client.git","clone_url":"https://github.com/mozilla/fxa-js-client.git","svn_url":"https://github.com/mozilla/fxa-js-client","homepage":"","size":1166,"stargazers_count":22,"watchers_count":22,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":2,"forks":19,"open_issues":2,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187"},"html":{"href":"https://github.com/mozilla/fxa-js-client/pull/187"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/issues/187"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/issues/187/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/pulls/187/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-js-client/statuses/4449f3752301bbf9d9adde4eca17d479f8b12293"}}}}