Add analytics on search pages
parent
9199247e5d
commit
b1229d5bd0
|
@ -177,7 +177,7 @@ module.directive("tgSearchBox", SearchBoxDirective)
|
|||
## Search Directive
|
||||
#############################################################################
|
||||
|
||||
SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
||||
SearchDirective = ($log, $compile, $templatecache, $routeparams, $location, $analytics) ->
|
||||
linkTable = ($scope, $el, $attrs, $ctrl) ->
|
||||
applyAutoTab = true
|
||||
activeSectionName = "userstories"
|
||||
|
@ -261,6 +261,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
|||
|
||||
$scope.$watch "searchTerm", (searchTerm) ->
|
||||
$location.search("text", searchTerm) if searchTerm != undefined
|
||||
$analytics.trackPage($location.url(), "Search")
|
||||
|
||||
$el.on "click", ".search-filter li > a", (event) ->
|
||||
event.preventDefault()
|
||||
|
@ -288,5 +289,5 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
|||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgSearch", ["$log", "$compile", "$templateCache", "$routeParams", "$tgLocation",
|
||||
module.directive("tgSearch", ["$log", "$compile", "$templateCache", "$routeParams", "$tgLocation", "$tgAnalytics",
|
||||
SearchDirective])
|
||||
|
|
|
@ -22,11 +22,13 @@ class DiscoverSearchController
|
|||
'$routeParams',
|
||||
'tgDiscoverProjectsService',
|
||||
'$route',
|
||||
'$tgLocation',
|
||||
'$tgAnalytics',
|
||||
'tgAppMetaService',
|
||||
'$translate'
|
||||
]
|
||||
|
||||
constructor: (@routeParams, @discoverProjectsService, @route, @appMetaService, @translate) ->
|
||||
constructor: (@routeParams, @discoverProjectsService, @route, @location, @analytics, @appMetaService, @translate) ->
|
||||
@.page = 1
|
||||
|
||||
taiga.defineImmutableProperty @, "searchResult", () => return @discoverProjectsService.searchResult
|
||||
|
@ -43,6 +45,7 @@ class DiscoverSearchController
|
|||
title = @translate.instant("DISCOVER.SEARCH.PAGE_TITLE")
|
||||
description = @translate.instant("DISCOVER.SEARCH.PAGE_DESCRIPTION")
|
||||
@appMetaService.setAll(title, description)
|
||||
@analytics.trackPage(@location.url(), "Discover Search")
|
||||
|
||||
fetch: () ->
|
||||
@.page = 1
|
||||
|
@ -105,6 +108,7 @@ class DiscoverSearchController
|
|||
filter: @.filter,
|
||||
text: @.q
|
||||
})
|
||||
@analytics.trackPage(@location.url(), "Discover Search")
|
||||
|
||||
@.fetchByGlobalSearch()
|
||||
|
||||
|
@ -114,6 +118,7 @@ class DiscoverSearchController
|
|||
@route.updateParams({
|
||||
order_by: orderBy
|
||||
})
|
||||
@analytics.trackPage(@location.url(), "Discover Search")
|
||||
|
||||
@.fetchByOrderBy()
|
||||
|
||||
|
|
|
@ -716,7 +716,7 @@ gulp.task("express", function() {
|
|||
res.sendFile("index.html", {root: __dirname + "/dist/"});
|
||||
});
|
||||
|
||||
app.listen(9001);
|
||||
app.listen(9002);
|
||||
});
|
||||
|
||||
//Rerun the task when a file changes
|
||||
|
|
Loading…
Reference in New Issue