{"action":"created","comment":{"url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments/79345001","id":79345001,"diff_hunk":"@@ -0,0 +1,62 @@\n+var ec_tracking;\n+ec_tracking = function() {\n+  $('.add-to-cart-track').on('click', function() {\n+    var id = $(this).data('item-id');\n+    var name = $(this).data('item-name');\n+    var price = $(this).data('item-price');\n+\n+    if (typeof id !== \"undefined\" && typeof name !== \"undefined\" && price !== \"undefined\") {\n+      fbq('track', 'AddToCart', {\n+        content_name: name,\n+        content_ids: [id],\n+        content_type: 'product',\n+        value: price,\n+        currency: 'TWD'\n+      });\n+\n+      ga('ec:addProduct', {\n+        'id': id,\n+        'name': name,\n+        'price': price\n+      });\n+      ga('ec:setAction', 'add');\n+      ga('send', 'event', 'product', 'add to cart', name);\n+    }\n+  });\n+\n+  $('.cart-item-delete').on('click', function() {\n+    var id = $(this).data('item-id');\n+    var name = $(this).data('item-name');\n+    var price = $(this).data('item-price');\n+\n+    if (typeof id !== \"undefined\" && typeof name !== \"undefined\" && price !== \"undefined\") {\n+      fbq('trackCustom', 'RemoveFromCart', {\n+        content_name: name,\n+        content_ids: [id],\n+        content_type: 'product',\n+        value: price,\n+        currency: 'TWD'\n+      });\n+\n+      ga('ec:addProduct', {\n+        'id': id,\n+        'name': name,\n+        'price': price\n+      });\n+      ga('ec:setAction', 'remove');\n+      ga('send', 'event', 'checkout_step_1', 'click', \"product_delete\");\n+    }\n+  });\n+\n+  $('.category-or-item-show').on('click', function() {","path":"app/assets/javascripts/ga_and_fb_tracking_event.js","position":51,"original_position":51,"commit_id":"9542842a2b9b2a99798413b8ab81509c7d668593","original_commit_id":"9542842a2b9b2a99798413b8ab81509c7d668593","user":{"login":"StevenKo","id":1100488,"avatar_url":"https://avatars.githubusercontent.com/u/1100488?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenKo","html_url":"https://github.com/StevenKo","followers_url":"https://api.github.com/users/StevenKo/followers","following_url":"https://api.github.com/users/StevenKo/following{/other_user}","gists_url":"https://api.github.com/users/StevenKo/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenKo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenKo/subscriptions","organizations_url":"https://api.github.com/users/StevenKo/orgs","repos_url":"https://api.github.com/users/StevenKo/repos","events_url":"https://api.github.com/users/StevenKo/events{/privacy}","received_events_url":"https://api.github.com/users/StevenKo/received_events","type":"User","site_admin":false},"body":"category 跟 item 的 show 為什麼會想要綁在一起？","created_at":"2016-09-19T08:29:50Z","updated_at":"2016-09-19T08:29:54Z","html_url":"https://github.com/kosbrother/mongmongwoo/pull/291#discussion_r79345001","pull_request_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291","_links":{"self":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments/79345001"},"html":{"href":"https://github.com/kosbrother/mongmongwoo/pull/291#discussion_r79345001"},"pull_request":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291"}}},"pull_request":{"url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291","id":85153570,"html_url":"https://github.com/kosbrother/mongmongwoo/pull/291","diff_url":"https://github.com/kosbrother/mongmongwoo/pull/291.diff","patch_url":"https://github.com/kosbrother/mongmongwoo/pull/291.patch","issue_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/291","number":291,"state":"open","locked":false,"title":"Web ga and fb ec tracking","user":{"login":"gvszg","id":7985560,"avatar_url":"https://avatars.githubusercontent.com/u/7985560?v=3","gravatar_id":"","url":"https://api.github.com/users/gvszg","html_url":"https://github.com/gvszg","followers_url":"https://api.github.com/users/gvszg/followers","following_url":"https://api.github.com/users/gvszg/following{/other_user}","gists_url":"https://api.github.com/users/gvszg/gists{/gist_id}","starred_url":"https://api.github.com/users/gvszg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvszg/subscriptions","organizations_url":"https://api.github.com/users/gvszg/orgs","repos_url":"https://api.github.com/users/gvszg/repos","events_url":"https://api.github.com/users/gvszg/events{/privacy}","received_events_url":"https://api.github.com/users/gvszg/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-14T01:33:16Z","updated_at":"2016-09-19T08:29:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbf1e498f1a5695be76983b56428c10d30046efe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291/commits","review_comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291/comments","review_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/291/comments","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/9542842a2b9b2a99798413b8ab81509c7d668593","head":{"label":"kosbrother:web-ga-and-fb-ec-tracking","ref":"web-ga-and-fb-ec-tracking","sha":"9542842a2b9b2a99798413b8ab81509c7d668593","user":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"repo":{"id":56124462,"name":"mongmongwoo","full_name":"kosbrother/mongmongwoo","owner":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kosbrother/mongmongwoo","description":"","fork":false,"url":"https://api.github.com/repos/kosbrother/mongmongwoo","forks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/forks","keys_url":"https://api.github.com/repos/kosbrother/mongmongwoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kosbrother/mongmongwoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kosbrother/mongmongwoo/teams","hooks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/hooks","issue_events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/events{/number}","events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/events","assignees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/assignees{/user}","branches_url":"https://api.github.com/repos/kosbrother/mongmongwoo/branches{/branch}","tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/tags","blobs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/{sha}","languages_url":"https://api.github.com/repos/kosbrother/mongmongwoo/languages","stargazers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/stargazers","contributors_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contributors","subscribers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscribers","subscription_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscription","commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contents/{+path}","compare_url":"https://api.github.com/repos/kosbrother/mongmongwoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kosbrother/mongmongwoo/merges","archive_url":"https://api.github.com/repos/kosbrother/mongmongwoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kosbrother/mongmongwoo/downloads","issues_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues{/number}","pulls_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls{/number}","milestones_url":"https://api.github.com/repos/kosbrother/mongmongwoo/milestones{/number}","notifications_url":"https://api.github.com/repos/kosbrother/mongmongwoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kosbrother/mongmongwoo/labels{/name}","releases_url":"https://api.github.com/repos/kosbrother/mongmongwoo/releases{/id}","deployments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/deployments","created_at":"2016-04-13T05:46:41Z","updated_at":"2016-04-13T05:47:43Z","pushed_at":"2016-09-19T07:23:58Z","git_url":"git://github.com/kosbrother/mongmongwoo.git","ssh_url":"git@github.com:kosbrother/mongmongwoo.git","clone_url":"https://github.com/kosbrother/mongmongwoo.git","svn_url":"https://github.com/kosbrother/mongmongwoo","homepage":null,"size":10041,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"kosbrother:master","ref":"master","sha":"68680275cbab74198dfc6863fd6cb18eae569c97","user":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"repo":{"id":56124462,"name":"mongmongwoo","full_name":"kosbrother/mongmongwoo","owner":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kosbrother/mongmongwoo","description":"","fork":false,"url":"https://api.github.com/repos/kosbrother/mongmongwoo","forks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/forks","keys_url":"https://api.github.com/repos/kosbrother/mongmongwoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kosbrother/mongmongwoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kosbrother/mongmongwoo/teams","hooks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/hooks","issue_events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/events{/number}","events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/events","assignees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/assignees{/user}","branches_url":"https://api.github.com/repos/kosbrother/mongmongwoo/branches{/branch}","tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/tags","blobs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/{sha}","languages_url":"https://api.github.com/repos/kosbrother/mongmongwoo/languages","stargazers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/stargazers","contributors_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contributors","subscribers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscribers","subscription_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscription","commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contents/{+path}","compare_url":"https://api.github.com/repos/kosbrother/mongmongwoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kosbrother/mongmongwoo/merges","archive_url":"https://api.github.com/repos/kosbrother/mongmongwoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kosbrother/mongmongwoo/downloads","issues_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues{/number}","pulls_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls{/number}","milestones_url":"https://api.github.com/repos/kosbrother/mongmongwoo/milestones{/number}","notifications_url":"https://api.github.com/repos/kosbrother/mongmongwoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kosbrother/mongmongwoo/labels{/name}","releases_url":"https://api.github.com/repos/kosbrother/mongmongwoo/releases{/id}","deployments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/deployments","created_at":"2016-04-13T05:46:41Z","updated_at":"2016-04-13T05:47:43Z","pushed_at":"2016-09-19T07:23:58Z","git_url":"git://github.com/kosbrother/mongmongwoo.git","ssh_url":"git@github.com:kosbrother/mongmongwoo.git","clone_url":"https://github.com/kosbrother/mongmongwoo.git","svn_url":"https://github.com/kosbrother/mongmongwoo","homepage":null,"size":10041,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291"},"html":{"href":"https://github.com/kosbrother/mongmongwoo/pull/291"},"issue":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/291"},"comments":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/291/comments"},"review_comments":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291/comments"},"review_comment":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/291/commits"},"statuses":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/9542842a2b9b2a99798413b8ab81509c7d668593"}}}}
{"actor":{"display_login":"StevenKo"}}