GoWindGoWind
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
  • Introduction

    • GoWind UBA Product Introduction
  • Architecture Reference

    • UBA System Architecture
    • UBA Backend Module Overview
    • UBA Backend API Contract
    • UBA Frontend Architecture
  • Developer Guide

    • UBA Installation Guide
    • UBA Code Generation Pipeline Tutorial
    • Adding an External Service Tutorial
    • Adding a Business Entity Tutorial
    • Adding a Frontend Page Tutorial
  • Operations Guide

    • UBA Docker Deployment Guide
    • UBA Configuration Reference & Security Checklist
    • UBA PM2 Deployment Guide
    • UBA Superset BI Deployment Guide
  • Analyst Guide

    • Data Analyst Getting Started Guide
    • Basic Aggregation

      • Event Trend Analysis
      • Active Users Analysis
      • Group By Aggregation
    • Conversion & Paths

      • Funnel Analysis
      • Retention Analysis
      • Top Conversion Paths
      • Behavior Sequence Analysis
    • User Depth

      • Attribution Analysis
      • Distribution Analysis
      • User Segmentation
      • Click Heatmap
      • Interval Analysis
    • Lifecycle

      • User Lifecycle
      • Churn & Reactivation Analysis
      • New vs Returning Users
      • Matrix Quadrant Analysis
    • Revenue & Value

      • Revenue Analysis
      • Whale Tier (Payer Segmentation)
      • Historical LTV Analysis
    • Sessions & Anomalies

      • Session Analysis
      • Period-over-Period Comparison and Anomaly Detection
    • Gaming

      • Level Analysis (Game)
      • Server Retention (Game)
      • Online Stats Analysis (Game)
      • Economy Analysis (Game)
    • OLAP Cookbook
  • SDK Integration

    • Web SDK Integration Guide
    • C# SDK Integration Guide (Unity / Godot / .NET)
  • Appendix

    • UBA Appendix: Ports, Glossary, Known Limitations & FAQ

Group By Aggregation

Group By Aggregation (GroupBy) groups event metrics by a dimension field (platform, channel, region, version, etc.), answering "what does the distribution/comparison look like when viewed by dimension X". It corresponds to the backend AnalyticsService.GroupBy.


1. What Questions It Answers

  • What share of event volume does each channel (channel) contribute? Which channel is the largest?
  • How do the three platforms iOS / Android / Web compare in activity?
  • What is the user distribution across app versions?

2. Key Concepts

ConceptDescription
DimensionThe field to group by, restricted to the whitelist (see below)
MetricAggregation method: COUNT event count (default) / UNIQUE_USER distinct users / SUM_AMOUNT amount sum
PercentageEach group's share of the total

Supported whitelist dimensions: platform / channel / country / app_version / event_name / event_category / os / network (game models additionally support server_id / level, etc.).


3. Backend API

gRPC: AnalyticsService.GroupBy

FieldTypeDescription
time_rangeTimeRangeAnalysis time range
dimensionstringDimension field name to group by (must be on the whitelist)
metricstring (optional)COUNT / UNIQUE_USER / SUM_AMOUNT, default COUNT
app_iduint32 (optional)Filter by app
event_namestring (optional)Event name filter (empty = all events)
top_nuint32 (optional)Return the top N groups, default 20

Response GroupByResponse: buckets[] (each GroupByBucket contains label / value / percentage), dimension, total.

HTTP (admin proxy)

POST /admin/v1/analytics/group-by
Content-Type: application/json

{
  "timeRange": { "startMs": 1718169600000, "endMs": 1718774399000 },
  "dimension": "channel",
  "metric": "UNIQUE_USER",
  "topN": 10
}

4. Underlying SQL

SELECT channel AS label, count(DISTINCT user_id) AS value
FROM events_fact
WHERE event_time BETWEEN :start AND :end
GROUP BY channel
ORDER BY value DESC
LIMIT 10;

The application layer then divides each group's value by total to get percentage.

Dimension fields are validated against a whitelist (to prevent SQL injection): only the whitelisted field names above may be used as dimension; anything else is rejected by the backend.


5. Typical Scenarios

Channel quality assessment

dimension=channel, metric=UNIQUE_USER: view the distinct user count per channel to gauge the user acquisition scale of each acquisition channel.

Version distribution

dimension=app_version, metric=COUNT: view event volume per version to track version migration progress and spot anomalies in new releases.

Platform comparison

dimension=platform: compare event scale across Web/iOS/Android.


6. Notes and Caveats

  • Dimensions must be on the whitelist: custom fields cannot be used as a dimension directly (use properties custom attributes through other analyses, or write your own queries in Superset).
  • top_n truncation: long-tail groups (e.g. hundreds of countries) are truncated to the top N; the remainder is not listed separately.
  • SUM_AMOUNT depends on the amount field: it is only meaningful for events that populate amount when reporting (e.g. payments).

7. Related Documents

  • Data Analyst Getting Started Guide
  • Event Trend Analysis
  • Revenue Analysis
  • Backend API Contract
Edit this page
Last Updated:: 11/3/26, 2:14 PM
Contributors: Bobo
Prev
Active Users Analysis