diff --git a/app/coffee/modules/search.coffee b/app/coffee/modules/search.coffee index 760ea40b..e1e09b8c 100644 --- a/app/coffee/modules/search.coffee +++ b/app/coffee/modules/search.coffee @@ -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]) diff --git a/app/modules/discover/discover-search/discover-search.controller.coffee b/app/modules/discover/discover-search/discover-search.controller.coffee index 0f1aa4ac..b4205742 100644 --- a/app/modules/discover/discover-search/discover-search.controller.coffee +++ b/app/modules/discover/discover-search/discover-search.controller.coffee @@ -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() diff --git a/gulpfile.js b/gulpfile.js index 0e7d374a..f28862f6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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