{"action":"created","comment":{"url":"https://api.github.com/repos/poteto/ember-metrics/pulls/comments/34635756","id":34635756,"diff_hunk":"@@ -0,0 +1,92 @@\n+import Ember from 'ember';\n+import canUseDOM from '../utils/can-use-dom';\n+import objectTransforms from '../utils/object-transforms';\n+import BaseAdapter from './base';\n+\n+const {\n+  String: emberString,\n+  assert,\n+  get,\n+  merge,\n+  set,\n+  $\n+} = Ember;\n+\n+const {\n+  capitalize\n+} = emberString;\n+\n+const {\n+  compact\n+} = objectTransforms;\n+\n+export default BaseAdapter.extend({\n+  dataLayer: 'dataLayer',","path":"addon/metrics-adapters/google-tag-manager.js","position":24,"original_position":24,"commit_id":"bc3ac392f5461fb61be05b4fe8db92f451896958","original_commit_id":"bc3ac392f5461fb61be05b4fe8db92f451896958","user":{"login":"poteto","id":1390709,"avatar_url":"https://avatars.githubusercontent.com/u/1390709?v=3","gravatar_id":"","url":"https://api.github.com/users/poteto","html_url":"https://github.com/poteto","followers_url":"https://api.github.com/users/poteto/followers","following_url":"https://api.github.com/users/poteto/following{/other_user}","gists_url":"https://api.github.com/users/poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poteto/subscriptions","organizations_url":"https://api.github.com/users/poteto/orgs","repos_url":"https://api.github.com/users/poteto/repos","events_url":"https://api.github.com/users/poteto/events{/privacy}","received_events_url":"https://api.github.com/users/poteto/received_events","type":"User","site_admin":false},"body":"Could this just be:\r\n\r\n```js\r\nexport default BaseAdapter.extend({\r\n  toStringExtension() {\r\n    return 'GoogleTagManager';\r\n  },\r\n\r\ninit() {\r\n  const config = get(this, 'config');\r\n  let dataLayer = 'dataLayer';\r\n  const {\r\n    id,\r\n    dataLayer\r\n  } = config;\r\n\r\n  assert(`[ember-metrics] You must pass a valid \\`id\\` to the ${this.toString()} adapter`, id);\r\n\r\n  if (canUseDOM) {\r\n    /* jshint ignore:start */\r\n    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\r\n    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\r\n    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\r\n    '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\r\n    })(window,document,'script',dataLayer,id);\r\n    /* jshint ignore:end */\r\n  }\r\n},\r\n```","created_at":"2015-07-15T00:31:57Z","updated_at":"2015-07-15T00:31:57Z","html_url":"https://github.com/poteto/ember-metrics/pull/12#discussion_r34635756","pull_request_url":"https://api.github.com/repos/poteto/ember-metrics/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/comments/34635756"},"html":{"href":"https://github.com/poteto/ember-metrics/pull/12#discussion_r34635756"},"pull_request":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/poteto/ember-metrics/pulls/12","id":39977438,"html_url":"https://github.com/poteto/ember-metrics/pull/12","diff_url":"https://github.com/poteto/ember-metrics/pull/12.diff","patch_url":"https://github.com/poteto/ember-metrics/pull/12.patch","issue_url":"https://api.github.com/repos/poteto/ember-metrics/issues/12","number":12,"state":"open","locked":false,"title":"Added google tag manager adapter and test","user":{"login":"bl4ckm0r3","id":1441118,"avatar_url":"https://avatars.githubusercontent.com/u/1441118?v=3","gravatar_id":"","url":"https://api.github.com/users/bl4ckm0r3","html_url":"https://github.com/bl4ckm0r3","followers_url":"https://api.github.com/users/bl4ckm0r3/followers","following_url":"https://api.github.com/users/bl4ckm0r3/following{/other_user}","gists_url":"https://api.github.com/users/bl4ckm0r3/gists{/gist_id}","starred_url":"https://api.github.com/users/bl4ckm0r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl4ckm0r3/subscriptions","organizations_url":"https://api.github.com/users/bl4ckm0r3/orgs","repos_url":"https://api.github.com/users/bl4ckm0r3/repos","events_url":"https://api.github.com/users/bl4ckm0r3/events{/privacy}","received_events_url":"https://api.github.com/users/bl4ckm0r3/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-15T00:23:41Z","updated_at":"2015-07-15T00:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"543f7079f00d2ea83bcaf819bb115c67a44a34d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/poteto/ember-metrics/pulls/12/commits","review_comments_url":"https://api.github.com/repos/poteto/ember-metrics/pulls/12/comments","review_comment_url":"https://api.github.com/repos/poteto/ember-metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poteto/ember-metrics/issues/12/comments","statuses_url":"https://api.github.com/repos/poteto/ember-metrics/statuses/bc3ac392f5461fb61be05b4fe8db92f451896958","head":{"label":"bl4ckm0r3:google-tag-manager","ref":"google-tag-manager","sha":"bc3ac392f5461fb61be05b4fe8db92f451896958","user":{"login":"bl4ckm0r3","id":1441118,"avatar_url":"https://avatars.githubusercontent.com/u/1441118?v=3","gravatar_id":"","url":"https://api.github.com/users/bl4ckm0r3","html_url":"https://github.com/bl4ckm0r3","followers_url":"https://api.github.com/users/bl4ckm0r3/followers","following_url":"https://api.github.com/users/bl4ckm0r3/following{/other_user}","gists_url":"https://api.github.com/users/bl4ckm0r3/gists{/gist_id}","starred_url":"https://api.github.com/users/bl4ckm0r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl4ckm0r3/subscriptions","organizations_url":"https://api.github.com/users/bl4ckm0r3/orgs","repos_url":"https://api.github.com/users/bl4ckm0r3/repos","events_url":"https://api.github.com/users/bl4ckm0r3/events{/privacy}","received_events_url":"https://api.github.com/users/bl4ckm0r3/received_events","type":"User","site_admin":false},"repo":{"id":39096024,"name":"ember-metrics","full_name":"bl4ckm0r3/ember-metrics","owner":{"login":"bl4ckm0r3","id":1441118,"avatar_url":"https://avatars.githubusercontent.com/u/1441118?v=3","gravatar_id":"","url":"https://api.github.com/users/bl4ckm0r3","html_url":"https://github.com/bl4ckm0r3","followers_url":"https://api.github.com/users/bl4ckm0r3/followers","following_url":"https://api.github.com/users/bl4ckm0r3/following{/other_user}","gists_url":"https://api.github.com/users/bl4ckm0r3/gists{/gist_id}","starred_url":"https://api.github.com/users/bl4ckm0r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl4ckm0r3/subscriptions","organizations_url":"https://api.github.com/users/bl4ckm0r3/orgs","repos_url":"https://api.github.com/users/bl4ckm0r3/repos","events_url":"https://api.github.com/users/bl4ckm0r3/events{/privacy}","received_events_url":"https://api.github.com/users/bl4ckm0r3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bl4ckm0r3/ember-metrics","description":"Send data to multiple analytics integrations without re-implementing new API","fork":true,"url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics","forks_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/forks","keys_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/teams","hooks_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/hooks","issue_events_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/events","assignees_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/tags","blobs_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/languages","stargazers_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/stargazers","contributors_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/contributors","subscribers_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/subscribers","subscription_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/subscription","commits_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/merges","archive_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/downloads","issues_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/labels{/name}","releases_url":"https://api.github.com/repos/bl4ckm0r3/ember-metrics/releases{/id}","created_at":"2015-07-14T19:27:46Z","updated_at":"2015-07-14T19:27:46Z","pushed_at":"2015-07-14T23:50:21Z","git_url":"git://github.com/bl4ckm0r3/ember-metrics.git","ssh_url":"git@github.com:bl4ckm0r3/ember-metrics.git","clone_url":"https://github.com/bl4ckm0r3/ember-metrics.git","svn_url":"https://github.com/bl4ckm0r3/ember-metrics","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"poteto:develop","ref":"develop","sha":"58d887afe3e252f5dc40d751342c92b30413c265","user":{"login":"poteto","id":1390709,"avatar_url":"https://avatars.githubusercontent.com/u/1390709?v=3","gravatar_id":"","url":"https://api.github.com/users/poteto","html_url":"https://github.com/poteto","followers_url":"https://api.github.com/users/poteto/followers","following_url":"https://api.github.com/users/poteto/following{/other_user}","gists_url":"https://api.github.com/users/poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poteto/subscriptions","organizations_url":"https://api.github.com/users/poteto/orgs","repos_url":"https://api.github.com/users/poteto/repos","events_url":"https://api.github.com/users/poteto/events{/privacy}","received_events_url":"https://api.github.com/users/poteto/received_events","type":"User","site_admin":false},"repo":{"id":38898695,"name":"ember-metrics","full_name":"poteto/ember-metrics","owner":{"login":"poteto","id":1390709,"avatar_url":"https://avatars.githubusercontent.com/u/1390709?v=3","gravatar_id":"","url":"https://api.github.com/users/poteto","html_url":"https://github.com/poteto","followers_url":"https://api.github.com/users/poteto/followers","following_url":"https://api.github.com/users/poteto/following{/other_user}","gists_url":"https://api.github.com/users/poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poteto/subscriptions","organizations_url":"https://api.github.com/users/poteto/orgs","repos_url":"https://api.github.com/users/poteto/repos","events_url":"https://api.github.com/users/poteto/events{/privacy}","received_events_url":"https://api.github.com/users/poteto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/poteto/ember-metrics","description":"Send data to multiple analytics integrations without re-implementing new API","fork":false,"url":"https://api.github.com/repos/poteto/ember-metrics","forks_url":"https://api.github.com/repos/poteto/ember-metrics/forks","keys_url":"https://api.github.com/repos/poteto/ember-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poteto/ember-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poteto/ember-metrics/teams","hooks_url":"https://api.github.com/repos/poteto/ember-metrics/hooks","issue_events_url":"https://api.github.com/repos/poteto/ember-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/poteto/ember-metrics/events","assignees_url":"https://api.github.com/repos/poteto/ember-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/poteto/ember-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/poteto/ember-metrics/tags","blobs_url":"https://api.github.com/repos/poteto/ember-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poteto/ember-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poteto/ember-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/poteto/ember-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poteto/ember-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/poteto/ember-metrics/languages","stargazers_url":"https://api.github.com/repos/poteto/ember-metrics/stargazers","contributors_url":"https://api.github.com/repos/poteto/ember-metrics/contributors","subscribers_url":"https://api.github.com/repos/poteto/ember-metrics/subscribers","subscription_url":"https://api.github.com/repos/poteto/ember-metrics/subscription","commits_url":"https://api.github.com/repos/poteto/ember-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/poteto/ember-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/poteto/ember-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/poteto/ember-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/poteto/ember-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/poteto/ember-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poteto/ember-metrics/merges","archive_url":"https://api.github.com/repos/poteto/ember-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poteto/ember-metrics/downloads","issues_url":"https://api.github.com/repos/poteto/ember-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/poteto/ember-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/poteto/ember-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/poteto/ember-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poteto/ember-metrics/labels{/name}","releases_url":"https://api.github.com/repos/poteto/ember-metrics/releases{/id}","created_at":"2015-07-10T19:37:39Z","updated_at":"2015-07-14T09:25:44Z","pushed_at":"2015-07-15T00:23:41Z","git_url":"git://github.com/poteto/ember-metrics.git","ssh_url":"git@github.com:poteto/ember-metrics.git","clone_url":"https://github.com/poteto/ember-metrics.git","svn_url":"https://github.com/poteto/ember-metrics","homepage":"","size":0,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":28,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/12"},"html":{"href":"https://github.com/poteto/ember-metrics/pull/12"},"issue":{"href":"https://api.github.com/repos/poteto/ember-metrics/issues/12"},"comments":{"href":"https://api.github.com/repos/poteto/ember-metrics/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poteto/ember-metrics/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/poteto/ember-metrics/statuses/bc3ac392f5461fb61be05b4fe8db92f451896958"}}}}