Behavioral Segmentation
A behavioral segment is a query-defined subset at a stated grain and time. It is not a stable human type. Labels such as “power user” invite stories that the events do not contain; prefer operational names such as “used report export at least once in the window.”
Prerequisites
Complete engagement frequency and intensity. Reuse its eligible active-actor population so segment shares have a common denominator.
Learning goals
- Declare whether segments are exhaustive, mutually exclusive, or overlapping.
- Separate actor-, session-, and event-scoped conditions.
- Freeze lookback, eligibility, identity, and missingness rules.
- Treat segment comparisons as descriptive unless a causal design supports more.
A segment system, not a label list
This lesson partitions eligible active actors into feature adopters and active non-adopters. The two rules are mutually exclusive and exhaustive relative to the declared four-actor population. They are not exhaustive for every known account, and they say nothing about people whose data cannot be used for this purpose.
A different analysis may deliberately allow overlap—for example, “mobile session” and “used export.” Record scope and precedence. When small groups could expose sensitive behavior, aggregate or suppress them under a reviewed privacy policy instead of exporting row-level membership.
Metric contract
- Population: eligible active actors with valid, consented product activity on 2026-10-01 UTC.
- Unit: resolved actor × analysis window.
- Observation window: one UTC day, using the restated 2026-10-04 data close.
- Denominator: all four eligible active actors before applying the segment predicate.
- Missingness: invalid or unauthorized events do not create a third inferred persona; event absence may reflect missing collection.
- Identity: fixed 2026-10-02 snapshot; segment membership must not trigger new identity inference.
Worked example
import json
from datetime import datetime
from pathlib import Path
root = Path("tests/fixtures/product-analytics")
rows = [json.loads(line) for line in (root / "events-v1.jsonl").read_text().splitlines()]
plan = json.loads((root / "tracking-plan-v1.json").read_text())
parse = lambda value: datetime.fromisoformat(value.replace("Z", "+00:00"))
deduped = {}
for row in sorted(rows, key=lambda item: parse(item["received_at"])):
deduped.setdefault(row["event_id"], row)
def valid(row):
required = plan["events"][row["event_name"]]["required_properties"]
kinds = {"string": str, "boolean": bool}
return all(key in row["properties"] and isinstance(row["properties"][key], kinds[kind]) for key, kind in required.items())
def actor(row):
return row["user_id"] or plan["identity_snapshot"]["links"].get(row["anonymous_id"], row["anonymous_id"])
eligible = [row for row in deduped.values() if row["analytics_consent"] and row["purpose"] == "product_measurement" and valid(row)]
active = {actor(row) for row in eligible if row["event_name"] in {"page_view", "feature_used"}}
adopters = {actor(row) for row in eligible if row["event_name"] == "feature_used"}
non_adopters = active - adopters
print(f"feature_adopters={sorted(adopters)} active_non_adopters={sorted(non_adopters)}")
print(f"population={len(active)} exhaustive={adopters | non_adopters == active} overlapping={bool(adopters & non_adopters)} causal_effect=False")
Expected output:
feature_adopters=['u1', 'u3'] active_non_adopters=['anon-b', 'u2']
population=4 exhaustive=True overlapping=False causal_effect=False
Limitations and common mistakes
- Naming a segment as if it reveals motivation, satisfaction, or enduring identity.
- Comparing segment outcomes while ignoring self-selection, eligibility, and exposure.
- Changing lookback windows between runs without versioning the definition.
- Building tiny, sensitive groups or exporting membership beyond the declared purpose.
- Treating an invalid event as evidence that an actor belongs to the non-adopter segment.
Practice
Design overlapping “started signup” and “used export” segments. State their grain, lookback, denominator, intersection, and suppression rule. Then explain why their retention difference would remain descriptive.
Next steps
Path and journey analysis summarizes ordered event transitions while preserving loops, truncation, and selection limits.
Primary sources
Checked 2026-10-19: Google Analytics segment and filter scopes, W3C privacy principles for purpose and minimization, and Causal Inference: What If.