360 Secure SkillHub
360 安全技能中心

roblox-analytics

针对 Roblox 经济、漏斗、Journeys 和自定义事件,提供症状到原因再到修复的排错清单、事件限制说明、服务端 Luau 埋点示例,以及玩家分群和 A/B 分桶哈希注意事项。

分类:开发
TabooHarmony
热度 18.42
最近更新 2026-12-01 11:24:33

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add tabooharmony/roblox-brain/roblox-analytics
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
roblox-analytics
description
Use when adding, fixing or auditing Roblox AnalyticsService events: economy, funnels, Journeys, custom events, custom fields, limits.
when_to_use
Also when an event never shows in the dashboard, numbers don't match, a funnel shows zero or 100%, a custom field shows "Other", Journeys is empty, events fire from the client or Studio, or a shop/onboarding flow needs instrumenting.
last_reviewed
"2026-11-29T00:00:00.000Z"
sources
["https://create.roblox.com/docs/reference/engine/classes/AnalyticsService","https://create.roblox.com/docs/production/analytics/event-types","https://create.roblox.com/docs/production/analytics/economy-events","https://create.roblox.com/docs/production/analytics/funnel-events","https://create.roblox.com/docs/production/analytics/journey-events","https://create.roblox.com/docs/production/analytics/custom-events","https://create.roblox.com/docs/production/analytics/custom-fields","https://create.roblox.com/docs/cloud/guides/analytics","original"]

Roblox Analytics (AnalyticsService)

When to Load

Writing or reviewing AnalyticsService calls and the Economy, Funnel, Journeys and Explore (custom) dashboards they feed. Reading Creator Dashboard stats, experiments and Home signals: roblox-growth. Purchase grants: roblox-monetization. The built-in Studio MCP ships rbx-instrument-analytics to audit and add economy, funnel and custom events (roblox-studio-mcp).

Checked against the creator-docs mirror of 2026-11-25 unless marked "field".

Traps and review checklist (symptom -> cause -> fix)

  • Journeys page empty, or "will my funnel events show in Journeys?" -> No. Journeys records only AnalyticsService:LogJourneyEvent(player, journeyName, nodeName, journeySessionId?, customFields?) calls whose journey and node names exactly match a published Journeys config (Creator Hub > Analytics > Journeys, or Creator Config type JourneysConfig). Funnel and custom events never feed it. Configure the stages, then instrument every node from server code (§2).
  • Nothing appears after a Studio test -> events are sent only from the server in a published game; calls from Studio or a LocalScript record nothing. Test on a live server and check View Events (Economy, Funnel and Custom pages, near real time); charts take about 24 h.
  • Economy sink logged with a negative amount, or balance wrong -> amount is always positive (the flow type gives the direction; charts draw sinks negative); endingBalance must be >= 0 and is the value the committed mutation returned. Recomputing it from leaderstats, which already shows the grant, double-counts (100 + 50 commits 150, logs 200) (field).
  • Sixth currency missing -> docs conflict: the event-types table says 10 resource types, the LogEconomyEvent reference and Economy dashboard say 5. Plan for 5; put variants in a custom field (XP + field Class - Mage, not MageXP).
  • Breakdown shows "Other" -> limits are per experience: 8,000 unique combinations across all three custom fields combined, 20 transaction types, 100 item SKUs; past that, values group as "Other". Never put UserIds, timestamps, GUIDs or raw scores in a field; bucket them.
  • Recurring funnel (shop) shows one attempt per user -> LogFunnelStepEvent without a funnelSessionId ignores repeated steps, so a second shop visit never counts. Pass a GUID per attempt (or <userId>-<itemId> for upgrade paths). Only the 10 most recent session ids per user per funnel are tracked; reusing an older one starts a new session (§1).
  • Funnel shows zero -> a funnel starts only when its step 1 logs, and every step needs the same funnel name. Log step 1 at entry (PlayerAdded for onboarding).
  • Funnel shows no drop-off or 100% at early steps -> logging step N auto-completes all earlier steps, so out-of-order or skipped steps hide the real drop. Log each step at the same point, once, after the player completes it; numbers start at 1 (max 100).
  • Funnel split by platform or field looks wrong -> breakdowns use only the first step's player and field values, and the funnel belongs to the date the player entered. After editing steps, start the date range at the change date (§1).
  • Analytics Query API breakdown on custom fields fails -> its dimensions are CustomField1..CustomField3, not the enum's CustomField01; map them explicitly (roblox-cloud).
  • Kills, pickups, hits logged one call each -> the global rate limit is per minute and repeated funnel steps still count. Aggregate and send a value (LogCustomEvent(player, "ZombieKilled", 10)).

Limits

Limit Value
Currencies 5 per API reference (event-types table says 10)
Transaction types / item SKUs 20 / 100, then "Other"; no SKU shows N/A
Funnel session ids remembered 10 most recent per user per funnel
Journey stages / nodes per stage / name length 2-10 (+ automatic __entry__ stage 0) / 1-10 / 50 chars
Chart delay about 24 h; View Events near real time
Event data on dashboard rolls off 90 days after the last data received
Funnel and journey progress expires after 180 days without events (user counts as new)
Journey cohort follow-up 90 days after the selected range ends

1. Recurring funnels

  • A repeated step in the same session counts only its first instance.
-- Illustrative: one session id per checkout attempt, logged server-side after each step succeeds.
local sessionId = HttpService:GenerateGUID(false)
AnalyticsService:LogFunnelStepEvent(player, "ArmoryCheckout", sessionId, 1, "Opened Store")
-- later, same attempt:
AnalyticsService:LogFunnelStepEvent(player, "ArmoryCheckout", sessionId, 2, "Viewed Item")

2. Journeys (branching paths)

  • A stage holds alternative nodes that mean equal progress (ViewedSword or ViewedArmor). Funnels fit strict ordered steps; Journeys fit branches that reconnect, shown as a Sankey chart with Sessions and Users views.
  • You never pass a stage index: Roblox maps the node to its stage from the published config. A node not in the player's config version doesn't advance.
  • Progress only moves forward: repeating a node or logging an earlier stage does nothing; jumping ahead records the stages in between as skipped (funnels mark them completed).
  • Names: journey up to 50 chars of letters, digits, ., -, _, not starting with _; node names can't start with __ or contain commas, quotes, apostrophes or line breaks, unique within a stage.
  • Recurring journeys (shop visits) take a journeySessionId per attempt; one-time journeys omit it. Up to 3 custom fields.
  • Publishing an edit makes a new version and doesn't migrate progress: users keep the version they first acquired, so the old paths persist; pick the version in the filter. Configs are processed daily, so several publishes in one day count as the last one.

3. Player segments

AnalyticsService:GetPlayerSegmentsAsync(player) (server only, yields, cached per player for the server session) returns coarse buckets: EngagementLevel (days played in the last 7, e.g. High), UserAcquisitionSource (e.g. HomeRecommendation, Ads, Friends), UserNewReturningStatus, ExperienceActivationStatus, ActivePayerStatus and more. It doesn't throw when data is missing: HasData is false and every field is Unknown, so handle Unknown. Field: index each field in its own pcall; one missing property errored and lost the rest.

4. A/B assignment hash (field)

Plain FNV-1a on a UserId is not random enough: its low bit depends only on how many odd digits the id has, and neighbouring ids shared an arm 88% of the time. Add a finalizer (murmur3 fmix32), mirror the same function offline, and check about 50% agreement between neighbouring ids before shipping.

-- Illustrative: FNV-1a over "testId:userId", then murmur3 fmix32.
local function mul32(a: number, b: number): number
	local aLo, aHi = a % 65536, a // 65536
	return (aLo * b + ((aHi * b) % 65536) * 65536) % 4294967296
end

local function armHash(testId: string, userId: number): number
	local s = testId .. ":" .. tostring(userId)
	local h = 2166136261
	for i = 1, #s do
		h = mul32(bit32.bxor(h, string.byte(s, i)), 16777619)
	end
	h = mul32(bit32.bxor(h, bit32.rshift(h, 16)), 0x85EBCA6B)
	h = mul32(bit32.bxor(h, bit32.rshift(h, 13)), 0xC2B2AE35)
	return bit32.bxor(h, bit32.rshift(h, 16))
end
-- Arm: armHash(testId, player.UserId) % 10000 < splitBasisPoints