Aggiunge grafico andamento visite in admin Analytics.
Serie giornaliera di pageview/click/movimenti nel periodo filtrato, sopra la tabella pagine. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,23 @@ module Admin
|
||||
max_scroll: max_scroll_by_path[path].to_i
|
||||
}
|
||||
end.sort_by { |r| [-r[:pageviews], -r[:moves], -r[:clicks], r[:page_path]] }
|
||||
|
||||
pageviews_by_day = scope.group(:day).sum(:pageview_count)
|
||||
clicks_by_day = cell_scope.group(:day).sum(:click_count)
|
||||
moves_by_day = cell_scope.group(:day).sum(:move_count)
|
||||
@trend = (@filters[:from]..@filters[:to]).map do |day|
|
||||
{
|
||||
day: day.iso8601,
|
||||
pageviews: pageviews_by_day[day].to_i,
|
||||
clicks: clicks_by_day[day].to_i,
|
||||
moves: moves_by_day[day].to_i
|
||||
}
|
||||
end
|
||||
@trend_totals = {
|
||||
pageviews: @trend.sum { |r| r[:pageviews] },
|
||||
clicks: @trend.sum { |r| r[:clicks] },
|
||||
moves: @trend.sum { |r| r[:moves] }
|
||||
}
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user