{"action":"opened","number":34,"pull_request":{"url":"https://api.github.com/repos/tpitale/staccato/pulls/34","id":33603961,"html_url":"https://github.com/tpitale/staccato/pull/34","diff_url":"https://github.com/tpitale/staccato/pull/34.diff","patch_url":"https://github.com/tpitale/staccato/pull/34.patch","issue_url":"https://api.github.com/repos/tpitale/staccato/issues/34","number":34,"state":"open","locked":false,"title":"Add the ability to add custom_dimensions and metrics to a measurement object","user":{"login":"cavi21","id":146249,"avatar_url":"https://avatars.githubusercontent.com/u/146249?v=3","gravatar_id":"","url":"https://api.github.com/users/cavi21","html_url":"https://github.com/cavi21","followers_url":"https://api.github.com/users/cavi21/followers","following_url":"https://api.github.com/users/cavi21/following{/other_user}","gists_url":"https://api.github.com/users/cavi21/gists{/gist_id}","starred_url":"https://api.github.com/users/cavi21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cavi21/subscriptions","organizations_url":"https://api.github.com/users/cavi21/orgs","repos_url":"https://api.github.com/users/cavi21/repos","events_url":"https://api.github.com/users/cavi21/events{/privacy}","received_events_url":"https://api.github.com/users/cavi21/received_events","type":"User","site_admin":false},"body":"Hi @tpitale! me again, following the comments on PR #33 I propose this solution.\r\n\r\nI only add the feature to the `Staccato::Measurement::Product` only for now, in order to check with you if this is what you are having in mind for this feature? \r\n\r\nI follow your logic in the `Staccato::Hit` module. Only add a **\"control\"** method because not all the Measurement object are allowed to handle custom dimensions or metrics. I was planning to `raise` and `exception` but I saw that you are not raising anything so I just return nil if the `custom_dimensions_allowed?` or `custom_metrics_allowed?` return `false`\r\n\r\nAlso fix the test in order to show this new feature the way you planned.\r\nAnd now the `#add_measurement` method allow to receive an **object** or a **hash** (don't really like it the syntax I place in there, but it's literal at least :smile: )\r\n\r\nAll comments are welcome! and let me know If you want me to add all this stuff to the corresponding **objects**","created_at":"2015-04-18T15:48:42Z","updated_at":"2015-04-18T15:48:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tpitale/staccato/pulls/34/commits","review_comments_url":"https://api.github.com/repos/tpitale/staccato/pulls/34/comments","review_comment_url":"https://api.github.com/repos/tpitale/staccato/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tpitale/staccato/issues/34/comments","statuses_url":"https://api.github.com/repos/tpitale/staccato/statuses/801ddf3dc173052c499ed28f3625b2ab71d828ae","head":{"label":"goodpeople:add_custom_dimensions_and_metrics_following_tpitale_comments","ref":"add_custom_dimensions_and_metrics_following_tpitale_comments","sha":"801ddf3dc173052c499ed28f3625b2ab71d828ae","user":{"login":"goodpeople","id":152582,"avatar_url":"https://avatars.githubusercontent.com/u/152582?v=3","gravatar_id":"","url":"https://api.github.com/users/goodpeople","html_url":"https://github.com/goodpeople","followers_url":"https://api.github.com/users/goodpeople/followers","following_url":"https://api.github.com/users/goodpeople/following{/other_user}","gists_url":"https://api.github.com/users/goodpeople/gists{/gist_id}","starred_url":"https://api.github.com/users/goodpeople/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodpeople/subscriptions","organizations_url":"https://api.github.com/users/goodpeople/orgs","repos_url":"https://api.github.com/users/goodpeople/repos","events_url":"https://api.github.com/users/goodpeople/events{/privacy}","received_events_url":"https://api.github.com/users/goodpeople/received_events","type":"Organization","site_admin":false},"repo":{"id":34127135,"name":"staccato","full_name":"goodpeople/staccato","owner":{"login":"goodpeople","id":152582,"avatar_url":"https://avatars.githubusercontent.com/u/152582?v=3","gravatar_id":"","url":"https://api.github.com/users/goodpeople","html_url":"https://github.com/goodpeople","followers_url":"https://api.github.com/users/goodpeople/followers","following_url":"https://api.github.com/users/goodpeople/following{/other_user}","gists_url":"https://api.github.com/users/goodpeople/gists{/gist_id}","starred_url":"https://api.github.com/users/goodpeople/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodpeople/subscriptions","organizations_url":"https://api.github.com/users/goodpeople/orgs","repos_url":"https://api.github.com/users/goodpeople/repos","events_url":"https://api.github.com/users/goodpeople/events{/privacy}","received_events_url":"https://api.github.com/users/goodpeople/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/goodpeople/staccato","description":"Ruby library to perform server-side tracking into the official Google Analytics Measurement Protocol","fork":true,"url":"https://api.github.com/repos/goodpeople/staccato","forks_url":"https://api.github.com/repos/goodpeople/staccato/forks","keys_url":"https://api.github.com/repos/goodpeople/staccato/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goodpeople/staccato/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goodpeople/staccato/teams","hooks_url":"https://api.github.com/repos/goodpeople/staccato/hooks","issue_events_url":"https://api.github.com/repos/goodpeople/staccato/issues/events{/number}","events_url":"https://api.github.com/repos/goodpeople/staccato/events","assignees_url":"https://api.github.com/repos/goodpeople/staccato/assignees{/user}","branches_url":"https://api.github.com/repos/goodpeople/staccato/branches{/branch}","tags_url":"https://api.github.com/repos/goodpeople/staccato/tags","blobs_url":"https://api.github.com/repos/goodpeople/staccato/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goodpeople/staccato/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goodpeople/staccato/git/refs{/sha}","trees_url":"https://api.github.com/repos/goodpeople/staccato/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goodpeople/staccato/statuses/{sha}","languages_url":"https://api.github.com/repos/goodpeople/staccato/languages","stargazers_url":"https://api.github.com/repos/goodpeople/staccato/stargazers","contributors_url":"https://api.github.com/repos/goodpeople/staccato/contributors","subscribers_url":"https://api.github.com/repos/goodpeople/staccato/subscribers","subscription_url":"https://api.github.com/repos/goodpeople/staccato/subscription","commits_url":"https://api.github.com/repos/goodpeople/staccato/commits{/sha}","git_commits_url":"https://api.github.com/repos/goodpeople/staccato/git/commits{/sha}","comments_url":"https://api.github.com/repos/goodpeople/staccato/comments{/number}","issue_comment_url":"https://api.github.com/repos/goodpeople/staccato/issues/comments{/number}","contents_url":"https://api.github.com/repos/goodpeople/staccato/contents/{+path}","compare_url":"https://api.github.com/repos/goodpeople/staccato/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goodpeople/staccato/merges","archive_url":"https://api.github.com/repos/goodpeople/staccato/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goodpeople/staccato/downloads","issues_url":"https://api.github.com/repos/goodpeople/staccato/issues{/number}","pulls_url":"https://api.github.com/repos/goodpeople/staccato/pulls{/number}","milestones_url":"https://api.github.com/repos/goodpeople/staccato/milestones{/number}","notifications_url":"https://api.github.com/repos/goodpeople/staccato/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goodpeople/staccato/labels{/name}","releases_url":"https://api.github.com/repos/goodpeople/staccato/releases{/id}","created_at":"2015-04-17T16:25:51Z","updated_at":"2015-04-17T18:46:17Z","pushed_at":"2015-04-18T15:37:36Z","git_url":"git://github.com/goodpeople/staccato.git","ssh_url":"git@github.com:goodpeople/staccato.git","clone_url":"https://github.com/goodpeople/staccato.git","svn_url":"https://github.com/goodpeople/staccato","homepage":"","size":623,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tpitale:master","ref":"master","sha":"2bc907d0100542ca3d1dfa309e188db1a27a99d8","user":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"repo":{"id":11864512,"name":"staccato","full_name":"tpitale/staccato","owner":{"login":"tpitale","id":163,"avatar_url":"https://avatars.githubusercontent.com/u/163?v=3","gravatar_id":"","url":"https://api.github.com/users/tpitale","html_url":"https://github.com/tpitale","followers_url":"https://api.github.com/users/tpitale/followers","following_url":"https://api.github.com/users/tpitale/following{/other_user}","gists_url":"https://api.github.com/users/tpitale/gists{/gist_id}","starred_url":"https://api.github.com/users/tpitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpitale/subscriptions","organizations_url":"https://api.github.com/users/tpitale/orgs","repos_url":"https://api.github.com/users/tpitale/repos","events_url":"https://api.github.com/users/tpitale/events{/privacy}","received_events_url":"https://api.github.com/users/tpitale/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tpitale/staccato","description":"Ruby library to perform server-side tracking into the official Google Analytics Measurement Protocol","fork":false,"url":"https://api.github.com/repos/tpitale/staccato","forks_url":"https://api.github.com/repos/tpitale/staccato/forks","keys_url":"https://api.github.com/repos/tpitale/staccato/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tpitale/staccato/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tpitale/staccato/teams","hooks_url":"https://api.github.com/repos/tpitale/staccato/hooks","issue_events_url":"https://api.github.com/repos/tpitale/staccato/issues/events{/number}","events_url":"https://api.github.com/repos/tpitale/staccato/events","assignees_url":"https://api.github.com/repos/tpitale/staccato/assignees{/user}","branches_url":"https://api.github.com/repos/tpitale/staccato/branches{/branch}","tags_url":"https://api.github.com/repos/tpitale/staccato/tags","blobs_url":"https://api.github.com/repos/tpitale/staccato/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tpitale/staccato/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tpitale/staccato/git/refs{/sha}","trees_url":"https://api.github.com/repos/tpitale/staccato/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tpitale/staccato/statuses/{sha}","languages_url":"https://api.github.com/repos/tpitale/staccato/languages","stargazers_url":"https://api.github.com/repos/tpitale/staccato/stargazers","contributors_url":"https://api.github.com/repos/tpitale/staccato/contributors","subscribers_url":"https://api.github.com/repos/tpitale/staccato/subscribers","subscription_url":"https://api.github.com/repos/tpitale/staccato/subscription","commits_url":"https://api.github.com/repos/tpitale/staccato/commits{/sha}","git_commits_url":"https://api.github.com/repos/tpitale/staccato/git/commits{/sha}","comments_url":"https://api.github.com/repos/tpitale/staccato/comments{/number}","issue_comment_url":"https://api.github.com/repos/tpitale/staccato/issues/comments{/number}","contents_url":"https://api.github.com/repos/tpitale/staccato/contents/{+path}","compare_url":"https://api.github.com/repos/tpitale/staccato/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tpitale/staccato/merges","archive_url":"https://api.github.com/repos/tpitale/staccato/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tpitale/staccato/downloads","issues_url":"https://api.github.com/repos/tpitale/staccato/issues{/number}","pulls_url":"https://api.github.com/repos/tpitale/staccato/pulls{/number}","milestones_url":"https://api.github.com/repos/tpitale/staccato/milestones{/number}","notifications_url":"https://api.github.com/repos/tpitale/staccato/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tpitale/staccato/labels{/name}","releases_url":"https://api.github.com/repos/tpitale/staccato/releases{/id}","created_at":"2013-08-03T14:47:50Z","updated_at":"2015-04-17T21:06:18Z","pushed_at":"2015-04-17T22:01:51Z","git_url":"git://github.com/tpitale/staccato.git","ssh_url":"git@github.com:tpitale/staccato.git","clone_url":"https://github.com/tpitale/staccato.git","svn_url":"https://github.com/tpitale/staccato","homepage":"","size":623,"stargazers_count":67,"watchers_count":67,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":2,"forks":11,"open_issues":2,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tpitale/staccato/pulls/34"},"html":{"href":"https://github.com/tpitale/staccato/pull/34"},"issue":{"href":"https://api.github.com/repos/tpitale/staccato/issues/34"},"comments":{"href":"https://api.github.com/repos/tpitale/staccato/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/tpitale/staccato/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/tpitale/staccato/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tpitale/staccato/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/tpitale/staccato/statuses/801ddf3dc173052c499ed28f3625b2ab71d828ae"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":163,"deletions":27,"changed_files":4}}