Shane Kilkelly 10 лет назад
Родитель
Сommit
9919f5f44a

+ 1 - 1
services/web/app/views/layout.jade

@@ -49,7 +49,7 @@ html(itemscope, itemtype='http://schema.org/Product')
 				window.ga = function() { console.log("Sending to GA", arguments) };
 				window.ga = function() { console.log("Sending to GA", arguments) };
 
 
 		// Heap Analytics
 		// Heap Analytics
-		if (settings.analytics.heap && session && session.user)
+		if (settings.analytics && settings.analytics.heap && session && session.user)
 			script(type="text/javascript").
 			script(type="text/javascript").
 				window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var n=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(n?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(a,o);for(var r=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=r(p[c])};
 				window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var n=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(n?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(a,o);for(var r=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=r(p[c])};
 				heap.load("#{settings.analytics.heap.token}");
 				heap.load("#{settings.analytics.heap.token}");

+ 0 - 5
services/web/app/views/layout/footer.jade

@@ -41,8 +41,3 @@ footer.site-footer
 							a(href=item.url, class=item.class) !{item.text}
 							a(href=item.url, class=item.class) !{item.text}
 						else
 						else
 							| !{item.text}
 							| !{item.text}
-
-				li
-					a(href="https://heapanalytics.com/?utm_source=badge")
-						img(style="width:108px;height:41px" src="//heapanalytics.com/img/badgeLight.png" alt="Heap | Mobile and Web Analytics")
-

+ 1 - 2
services/web/public/coffee/main/event.coffee

@@ -7,8 +7,7 @@ define [
 			send: (category, action, label, value)->
 			send: (category, action, label, value)->
 				ga('send', 'event', category, action, label, value)
 				ga('send', 'event', category, action, label, value)
 				event_name = "#{action}-#{category}"
 				event_name = "#{action}-#{category}"
-				if window?.heap and window?.heap?.track
-					window.heap?.track(event_name, {label: label, value: value})
+				window?.heap?.track?(event_name, {label, value})
 		}
 		}