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{
|
||||
PerPage: config.PageSizeMemberSearch,
|
||||
Sort: sort,
|
||||
|
|
|
@ -109,6 +109,12 @@ func Search() http.HandlerFunc {
|
|||
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{}{
|
||||
"CurrentForumTab": "search",
|
||||
"Pager": pager,
|
||||
|
|
|
@ -38,6 +38,7 @@ const (
|
|||
ChangeLogBanned = "banned"
|
||||
ChangeLogAdmin = "admin" // admin status toggle
|
||||
ChangeLogLifecycle = "lifecycle" // de/reactivated accounts
|
||||
ChangeLogAnalytics = "analytics" // misc analytics
|
||||
)
|
||||
|
||||
var ChangeLogEventTypes = []string{
|
||||
|
@ -49,6 +50,7 @@ var ChangeLogEventTypes = []string{
|
|||
ChangeLogBanned,
|
||||
ChangeLogAdmin,
|
||||
ChangeLogLifecycle,
|
||||
ChangeLogAnalytics,
|
||||
}
|
||||
|
||||
// PaginateChangeLog lists the change logs.
|
||||
|
|
Loading…
Reference in New Issue
Block a user