Log search terms for analytics insight
This commit is contained in:
parent
61b047feaa
commit
9afe7718f1
|
@ -162,6 +162,15 @@ func Search() http.HandlerFunc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log the search terms for analytics.
|
||||||
|
if searchTerm != "" {
|
||||||
|
message := "Searched the member directory by keyword: " + searchTerm
|
||||||
|
if restricted != nil {
|
||||||
|
message += " (which was restricted)"
|
||||||
|
}
|
||||||
|
models.LogEvent(currentUser, nil, models.ChangeLogAnalytics, "users.search", 0, message)
|
||||||
|
}
|
||||||
|
|
||||||
pager := &models.Pagination{
|
pager := &models.Pagination{
|
||||||
PerPage: config.PageSizeMemberSearch,
|
PerPage: config.PageSizeMemberSearch,
|
||||||
Sort: sort,
|
Sort: sort,
|
||||||
|
|
|
@ -109,6 +109,12 @@ func Search() http.HandlerFunc {
|
||||||
log.Error("Couldn't MapCommentPhotos: %s", err)
|
log.Error("Couldn't MapCommentPhotos: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log the search terms for analytics.
|
||||||
|
if searchTerm != "" {
|
||||||
|
message := "Searched the forums by keyword: " + searchTerm
|
||||||
|
models.LogEvent(currentUser, nil, models.ChangeLogAnalytics, "forums.search", 0, message)
|
||||||
|
}
|
||||||
|
|
||||||
var vars = map[string]interface{}{
|
var vars = map[string]interface{}{
|
||||||
"CurrentForumTab": "search",
|
"CurrentForumTab": "search",
|
||||||
"Pager": pager,
|
"Pager": pager,
|
||||||
|
|
|
@ -38,6 +38,7 @@ const (
|
||||||
ChangeLogBanned = "banned"
|
ChangeLogBanned = "banned"
|
||||||
ChangeLogAdmin = "admin" // admin status toggle
|
ChangeLogAdmin = "admin" // admin status toggle
|
||||||
ChangeLogLifecycle = "lifecycle" // de/reactivated accounts
|
ChangeLogLifecycle = "lifecycle" // de/reactivated accounts
|
||||||
|
ChangeLogAnalytics = "analytics" // misc analytics
|
||||||
)
|
)
|
||||||
|
|
||||||
var ChangeLogEventTypes = []string{
|
var ChangeLogEventTypes = []string{
|
||||||
|
@ -49,6 +50,7 @@ var ChangeLogEventTypes = []string{
|
||||||
ChangeLogBanned,
|
ChangeLogBanned,
|
||||||
ChangeLogAdmin,
|
ChangeLogAdmin,
|
||||||
ChangeLogLifecycle,
|
ChangeLogLifecycle,
|
||||||
|
ChangeLogAnalytics,
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaginateChangeLog lists the change logs.
|
// PaginateChangeLog lists the change logs.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user