Ensure the current URL is recorded for GA

This commit is contained in:
Andrew Miner
2015-01-15 11:38:42 -08:00
parent 03eacc243c
commit f7fb6cd10e
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -45,14 +45,15 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
# Private Methods ##############################################################################
_recordPageView: ->
return if @_lastReportedHref is window.location.href
@_lastReportedHref = window.location.href
href = window.location.href
return if @_lastReportedHref is href
@_lastReportedHref = href
if global.env is 'production'
logger.info "Recording GA page view: #{window.location.href}"
ga('send', 'pageview')
logger.info "Recording GA page view: #{href}"
ga 'send', 'pageview', href
else
logger.info "Suppressing GA page view: #{window.location.href}"
logger.info "Suppressing GA page view: #{href}"
_setPage: (controllerName)->
controller = @_pageControllers[controllerName]