[backport] Minor improvement for make analyics more safe.
parent
ada62fcba4
commit
4b9e5ceb6e
|
@ -67,6 +67,7 @@ class AnalyticsService extends taiga.Service
|
||||||
|
|
||||||
trackPage: (url, title) ->
|
trackPage: (url, title) ->
|
||||||
return if not @.initialized
|
return if not @.initialized
|
||||||
|
return if not @win.ga
|
||||||
|
|
||||||
title = title or @doc[0].title
|
title = title or @doc[0].title
|
||||||
@win.ga("send", "pageview", {
|
@win.ga("send", "pageview", {
|
||||||
|
@ -76,6 +77,8 @@ class AnalyticsService extends taiga.Service
|
||||||
|
|
||||||
trackEvent: (category, action, label, value) ->
|
trackEvent: (category, action, label, value) ->
|
||||||
return if not @.initialized
|
return if not @.initialized
|
||||||
|
return if not @win.ga
|
||||||
|
|
||||||
@win.ga("send", "event", category, action, label, value)
|
@win.ga("send", "event", category, action, label, value)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue