rails_analytics 1.0.1 → 1.0.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f985132b2aa456db104a03635f1d8334772e8a5c8e3902319d111082d7a5f5b5
|
|
4
|
+
data.tar.gz: 8b4b04a1bab3a4c15b0cff8f44892146f5469713e325266054e8e23131937c8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 277a1e2be087cae4e5f511af0c3f3d56051ad625fadfe643356ae0697fbe6f353c8eef2a9e59c842899d051abdc232a93eea22f1faa4e631fb8fbe4ee0e29a1f
|
|
7
|
+
data.tar.gz: c1968ddf6c68fc5dee7856f61ffc94345da3855ee2d0d4188ca04756802ca47afbb252770014e96c567490180be008dedd87244e7c980b669f507c53c44e519a
|
data/README.md
CHANGED
|
@@ -42,8 +42,8 @@ dependencies.
|
|
|
42
42
|
3. The engine verifies the token, **masks the IP** (before anything hits disk),
|
|
43
43
|
derives a **daily anonymity key**, and stores a `Visit` row. Custom events are
|
|
44
44
|
stored as `Event` rows linked to the visit.
|
|
45
|
-
4. The **dashboard**
|
|
46
|
-
|
|
45
|
+
4. The **dashboard** at `/analytics` (default `mount_path`) shows aggregated metrics from
|
|
46
|
+
pure SQL queries in three views: overview, events, and visits.
|
|
47
47
|
|
|
48
48
|
## Requirements
|
|
49
49
|
|
|
@@ -236,7 +236,8 @@ cd test/dummy
|
|
|
236
236
|
bin/rails server
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
Then open
|
|
239
|
+
Then open (the bundled dummy mounts the engine at **`/rails_analytics`** as an example of a
|
|
240
|
+
custom mount — the gem's default is `/analytics`):
|
|
240
241
|
|
|
241
242
|
| URL | What you'll see |
|
|
242
243
|
|-----|-----------------|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
<title><%= t("rails_analytics.title") %></title>
|
|
8
|
-
<link rel="stylesheet" href="<%=
|
|
8
|
+
<link rel="stylesheet" href="<%= rails_analytics.dashboard_css_path %>" media="all">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<header class="ra-header">
|
data/config/routes.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
RailsAnalytics::Engine.routes.draw do
|
|
4
4
|
get "tracker.js" => "analytics#tracker"
|
|
5
|
-
get "dashboard.css" => "analytics#dashboard_css"
|
|
5
|
+
get "dashboard.css" => "analytics#dashboard_css", as: "dashboard_css"
|
|
6
6
|
post "collect" => "analytics#collect"
|
|
7
7
|
get "token" => "analytics#token"
|
|
8
8
|
root to: "dashboards#overview"
|
|
@@ -5,7 +5,8 @@ RailsAnalytics.configure do |config|
|
|
|
5
5
|
# Pode ser um Symbol (ex: :authenticate_admin!) ou um callable (ex: -> { current_user&.admin? }).
|
|
6
6
|
config.auth_callback = :authenticate_admin!
|
|
7
7
|
|
|
8
|
-
# Caminho onde o engine
|
|
8
|
+
# Caminho onde o engine é montado (debe coincidir com el mount en config/routes.rb).
|
|
9
|
+
# Padrão: "/analytics". Puedes cambiarlo libremente (ex: "/admin/analytics").
|
|
9
10
|
config.mount_path = "/analytics"
|
|
10
11
|
|
|
11
12
|
# Período padrão para as consultas do dashboard (ex: 30.days).
|