{"action":"created","issue":{"url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/24","repository_url":"https://api.github.com/repos/Tealium/integration-angularjs","labels_url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/24/comments","events_url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/24/events","html_url":"https://github.com/Tealium/integration-angularjs/issues/24","id":160949157,"number":24,"title":"No error catching","user":{"login":"Wavfact","id":587090,"avatar_url":"https://avatars.githubusercontent.com/u/587090?v=3","gravatar_id":"","url":"https://api.github.com/users/Wavfact","html_url":"https://github.com/Wavfact","followers_url":"https://api.github.com/users/Wavfact/followers","following_url":"https://api.github.com/users/Wavfact/following{/other_user}","gists_url":"https://api.github.com/users/Wavfact/gists{/gist_id}","starred_url":"https://api.github.com/users/Wavfact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wavfact/subscriptions","organizations_url":"https://api.github.com/users/Wavfact/orgs","repos_url":"https://api.github.com/users/Wavfact/repos","events_url":"https://api.github.com/users/Wavfact/events{/privacy}","received_events_url":"https://api.github.com/users/Wavfact/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-17T18:33:26Z","updated_at":"2016-06-17T19:20:46Z","closed_at":null,"body":"We noticed a bug with the code..  Granted, it's edge case..\r\n\r\nIf you are running ghostery and have disabled Tealium, it will error out the page with \"TypeError: utag.view is not a function\", TypeError: utag.link is not a function\" and \"TypeError: utag.track is not a function\".  \r\n\r\nThis could probably be resolved with wrapping them in try/catch?\r\n\r\n```\r\nvar track = function( ev, data ) {\r\n        var data = data || tealiumData.getDataLayer( $location.path() );\r\n        var ev = ev || \"view\";\r\n        var src = config.script_src;\r\n\r\n        if ( typeof utag == \"undefined\" ) {\r\n          getScript( src, function(){\r\n              try {\r\n                  utag.track(ev, data)\r\n              }\r\n              catch(err){return false;}\r\n          })\r\n        } else {\r\n            try {\r\n                utag.track(ev, data)\r\n            }\r\n            catch(err){return false;}\r\n        }\r\n\r\n      };\r\n```\r\n\r\nDennis"},"comment":{"url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/comments/226858576","html_url":"https://github.com/Tealium/integration-angularjs/issues/24#issuecomment-226858576","issue_url":"https://api.github.com/repos/Tealium/integration-angularjs/issues/24","id":226858576,"user":{"login":"tygavin","id":1738148,"avatar_url":"https://avatars.githubusercontent.com/u/1738148?v=3","gravatar_id":"","url":"https://api.github.com/users/tygavin","html_url":"https://github.com/tygavin","followers_url":"https://api.github.com/users/tygavin/followers","following_url":"https://api.github.com/users/tygavin/following{/other_user}","gists_url":"https://api.github.com/users/tygavin/gists{/gist_id}","starred_url":"https://api.github.com/users/tygavin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tygavin/subscriptions","organizations_url":"https://api.github.com/users/tygavin/orgs","repos_url":"https://api.github.com/users/tygavin/repos","events_url":"https://api.github.com/users/tygavin/events{/privacy}","received_events_url":"https://api.github.com/users/tygavin/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T19:20:46Z","updated_at":"2016-06-17T19:20:46Z","body":"At a quick glance, it sounds like you are calling utag.view or utag.link directly in your page?  This module defines a wrapper called tealium.track that should be used instead.  The\r\n\r\n` if ( typeof utag == \"undefined\" ) {`\r\n\r\ncheck is designed to protect against this issue of calling tealium.view too soon (before the utag.js file is loaded.)  As long as this angular integration module is loaded you will have a new function to call  (\"tealium.track\") for use in your page.  Hopefully ghostery is not blocking the angular module from loading.\r\n\r\nThat said, we may still need the try/catch inside the getScript callback as you mention.  I'll do a test in with Ghostery on to see if this callback function still executes when they block the js file."}}
{"actor":{"display_login":"tygavin"}}