active_analytics 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +53 -0
- data/Rakefile +18 -0
- data/app/assets/config/active_analytics_manifest.js +1 -0
- data/app/assets/javascripts/active_analytics/application.js +3 -0
- data/app/assets/javascripts/active_analytics/ariato.js +746 -0
- data/app/assets/stylesheets/active_analytics/application.css +33 -0
- data/app/assets/stylesheets/active_analytics/ariato.css +3548 -0
- data/app/assets/stylesheets/active_analytics/charts.css +2606 -0
- data/app/controllers/active_analytics/application_controller.rb +4 -0
- data/app/controllers/active_analytics/pages_controller.rb +22 -0
- data/app/controllers/active_analytics/referrers_controller.rb +18 -0
- data/app/controllers/active_analytics/sites_controller.rb +16 -0
- data/app/helpers/active_analytics/application_helper.rb +4 -0
- data/app/helpers/active_analytics/pages_helper.rb +15 -0
- data/app/helpers/active_analytics/referrers_helper.rb +4 -0
- data/app/helpers/active_analytics/sites_helper.rb +4 -0
- data/app/jobs/active_analytics/application_job.rb +4 -0
- data/app/mailers/active_analytics/application_mailer.rb +6 -0
- data/app/models/active_analytics/application_record.rb +5 -0
- data/app/models/active_analytics/views_per_day.rb +100 -0
- data/app/views/active_analytics/pages/_table.html.erb +21 -0
- data/app/views/active_analytics/pages/index.html.erb +12 -0
- data/app/views/active_analytics/pages/show.html.erb +23 -0
- data/app/views/active_analytics/referrers/_table.html.erb +14 -0
- data/app/views/active_analytics/referrers/index.html.erb +8 -0
- data/app/views/active_analytics/referrers/show.html.erb +14 -0
- data/app/views/active_analytics/sites/_histogram.html.erb +19 -0
- data/app/views/active_analytics/sites/index.html.erb +7 -0
- data/app/views/active_analytics/sites/show.html.erb +16 -0
- data/app/views/layouts/active_analytics/_footer.html.erb +6 -0
- data/app/views/layouts/active_analytics/_header.html.erb +25 -0
- data/app/views/layouts/active_analytics/application.html.erb +19 -0
- data/config/routes.rb +13 -0
- data/db/migrate/20210303094108_create_active_analytics_views_per_days.rb +20 -0
- data/lib/active_analytics.rb +22 -0
- data/lib/active_analytics/engine.rb +5 -0
- data/lib/active_analytics/version.rb +3 -0
- data/lib/tasks/active_analytics_tasks.rake +4 -0
- metadata +100 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateActiveAnalyticsViewsPerDays < ActiveRecord::Migration[5.2]
|
2
|
+
def up
|
3
|
+
create_table :active_analytics_views_per_days do |t|
|
4
|
+
t.string :site, null: false
|
5
|
+
t.string :page, null: false
|
6
|
+
t.date :date, null: false
|
7
|
+
t.bigint :total, null: false, default: 1
|
8
|
+
t.string :referrer_host
|
9
|
+
t.string :referrer_path
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
add_index :active_analytics_views_per_days, :date
|
13
|
+
add_index :active_analytics_views_per_days, [:site, :page, :date]
|
14
|
+
add_index :active_analytics_views_per_days, [:referrer_host, :referrer_path, :date], name: "index_active_analytics_views_per_days_on_referrer_and_date"
|
15
|
+
end
|
16
|
+
|
17
|
+
def down
|
18
|
+
drop_table :active_analytics_views_per_days
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "active_analytics/version"
|
2
|
+
require "active_analytics/engine"
|
3
|
+
|
4
|
+
module ActiveAnalytics
|
5
|
+
VERSION = "0.1.0"
|
6
|
+
|
7
|
+
def self.record_request(request)
|
8
|
+
params = {
|
9
|
+
site: request.host,
|
10
|
+
page: request.path,
|
11
|
+
date: Date.today,
|
12
|
+
}
|
13
|
+
if request.referer.present?
|
14
|
+
referrer_uri = URI(request.referrer)
|
15
|
+
params[:referrer_host] = referrer_uri.host
|
16
|
+
params[:referrer_path] = referrer_uri.path
|
17
|
+
end
|
18
|
+
ViewsPerDay.append(params)
|
19
|
+
rescue => ex
|
20
|
+
raise if Rails.env.development?
|
21
|
+
end
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: active_analytics
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexis Bernard
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.2.0
|
27
|
+
description: NO cookies, NO JavaScript, NO third parties and NO bullshit
|
28
|
+
email:
|
29
|
+
- alexis@basesecrete.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- MIT-LICENSE
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- app/assets/config/active_analytics_manifest.js
|
38
|
+
- app/assets/javascripts/active_analytics/application.js
|
39
|
+
- app/assets/javascripts/active_analytics/ariato.js
|
40
|
+
- app/assets/stylesheets/active_analytics/application.css
|
41
|
+
- app/assets/stylesheets/active_analytics/ariato.css
|
42
|
+
- app/assets/stylesheets/active_analytics/charts.css
|
43
|
+
- app/controllers/active_analytics/application_controller.rb
|
44
|
+
- app/controllers/active_analytics/pages_controller.rb
|
45
|
+
- app/controllers/active_analytics/referrers_controller.rb
|
46
|
+
- app/controllers/active_analytics/sites_controller.rb
|
47
|
+
- app/helpers/active_analytics/application_helper.rb
|
48
|
+
- app/helpers/active_analytics/pages_helper.rb
|
49
|
+
- app/helpers/active_analytics/referrers_helper.rb
|
50
|
+
- app/helpers/active_analytics/sites_helper.rb
|
51
|
+
- app/jobs/active_analytics/application_job.rb
|
52
|
+
- app/mailers/active_analytics/application_mailer.rb
|
53
|
+
- app/models/active_analytics/application_record.rb
|
54
|
+
- app/models/active_analytics/views_per_day.rb
|
55
|
+
- app/views/active_analytics/pages/_table.html.erb
|
56
|
+
- app/views/active_analytics/pages/index.html.erb
|
57
|
+
- app/views/active_analytics/pages/show.html.erb
|
58
|
+
- app/views/active_analytics/referrers/_table.html.erb
|
59
|
+
- app/views/active_analytics/referrers/index.html.erb
|
60
|
+
- app/views/active_analytics/referrers/show.html.erb
|
61
|
+
- app/views/active_analytics/sites/_histogram.html.erb
|
62
|
+
- app/views/active_analytics/sites/index.html.erb
|
63
|
+
- app/views/active_analytics/sites/show.html.erb
|
64
|
+
- app/views/layouts/active_analytics/_footer.html.erb
|
65
|
+
- app/views/layouts/active_analytics/_header.html.erb
|
66
|
+
- app/views/layouts/active_analytics/application.html.erb
|
67
|
+
- config/routes.rb
|
68
|
+
- db/migrate/20210303094108_create_active_analytics_views_per_days.rb
|
69
|
+
- lib/active_analytics.rb
|
70
|
+
- lib/active_analytics/engine.rb
|
71
|
+
- lib/active_analytics/version.rb
|
72
|
+
- lib/tasks/active_analytics_tasks.rake
|
73
|
+
homepage: https://github.com/BaseSecrete/active_analytics
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata:
|
77
|
+
allowed_push_host: https://rubygems.org
|
78
|
+
homepage_uri: https://github.com/BaseSecrete/active_analytics
|
79
|
+
source_code_uri: https://github.com/BaseSecrete/active_analytics
|
80
|
+
changelog_uri: https://github.com/BaseSecrete/active_analytics
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubygems_version: 3.0.3
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: Trafic analytics for the win of privacy
|
100
|
+
test_files: []
|