Asopitech With · Web analytics
Google Analytics with Alopex DB
Google Analytics is an analytics service that measures how people use sites and apps. What would it look like built on Alopex DB?
Updated: Oct 12, 2026
What the service does
Google Analytics measures how people use sites and apps. It collects events such as page views and purchases and presents them in reports. The data is events, users, sessions and the parameters attached to each event.
Where the data lives
- Columnar tables: events are appended to a columnar table, and SQL aggregates counts per day, page and source.
- JSON: parameters that vary by event go in a JSON column.
- SQL tables: sites, goals and report definitions live in tables.
For analysis, Python reads the data as DataFrames and uses it directly for aggregation and charts.
Deployment
Alopex DB runs as a server that receives events from sites and apps. Analysts open the same data from the CLI or Python.
Why Alopex DB fits
Web analytics depends on aggregating an ever-growing stream of events quickly. Alopex DB handles columnar tables, SQL aggregation and DataFrame analysis in one database.
See it in code
Events are collected, and page-view counts per page come from SQL aggregation. Just the reporting core.
import alopex
db = alopex.Database.open("ga.alopex")
# イベントをためる(ページ表示などの記録)
db.execute_sql("""
CREATE TABLE IF NOT EXISTS events (
id INTEGER PRIMARY KEY,
name TEXT,
page TEXT,
ymd DATE
)
""")
events = [
(1, "page_view", "/top", "2026-10-20"),
(2, "page_view", "/top", "2026-10-20"),
(3, "page_view", "/pricing", "2026-10-20"),
(4, "page_view", "/top", "2026-10-21"),
(5, "purchase", "/pricing", "2026-10-21"),
]
for e in events:
db.execute_sql("INSERT INTO events (id, name, page, ymd) VALUES (?, ?, ?, ?)", list(e))
# ページ別のページビュー数を、多い順に集計する
rows = db.execute_sql("""
SELECT page, COUNT(*) AS views
FROM events
WHERE name = ?
GROUP BY page
ORDER BY views DESC
""", ["page_view"])
for row in rows:
print(row["page"], row["views"])GROUP BY rolls up the ever-growing events by page and day; the report is the SQL aggregation itself.
Alopex DB stores events in columnar tables and aggregates them with SQL and DataFrames. Keep your analytics in your own hands with it; the quickstart is your guide.