dd-instrument-product-analytics
БесплатноБез исполняемых скриптовНе проверенSwitches on Datadog Product Analytics (funnels, retention, pathways, user journeys) for a browser app that runs the Datadog RUM Browser SDK. Turns the product…
от datadog-labs★ 188 звёзд на GitHubОб этом скилле
Datadog Product Analytics
Product Analytics turns the sessions, page views and clicks that the Datadog RUM Browser SDK collects into funnels, retention, pathways and per-user journeys. It uses the same SDK and the same RUM application as RUM, so there is no second SDK to install.
How it works
- The switch is on the RUM application, not in the code. Product Analytics is enabled when the application has
product_analytics_retention_state: MAX. Without it, Product Analytics stays disabled even when the code is correct. - RUM comes first. Product Analytics reads what the RUM Browser SDK sends, so an app with no RUM init needs RUM set up first.
- Identity comes from
datadogRum.setUser. Without it, no journey is tied to an account. From SDK v6, visitors without a login are still counted anonymously, becausetrackAnonymousUserdefaults to true; v5 has no anonymous id. - Clicks need action collection.
trackUserInteractionsdefaults to true from SDK v6 and to false in v5. SDK v4 and older name the optiontrackInteractions. - Credentials. The application ID and client token are public and already in the RUM setup. Switching the product on through the API needs an API key and an application key, and both are secret.
Set up
Inspect. If the request or target project is a mobile app (iOS, Android, React Native, Flutter, or Kotlin Multiplatform), stop before any browser search or edit: say that this skill is for the browser product (
@datadog/browser-rum) only, and do not give the Manage Applications enable path. Otherwise, find the browser app; in a monorepo with several, ask which one. Search source and HTML files, skippingnode_modulesand build output, for the RUM setup: aninitcall on thedatadogRumimport from@datadog/browser-rum, including renamed imports and wrapper modules, or a CDNDD_RUM.init. Record the number of inits, the SDK version,trackUserInteractions, thesite(absent meansdatadoghq.com), the application ID, and how users sign in, through an auth library or the app's own session or user state. When the init reads the application ID or the site from environment variables, read only those lines of the env file, for examplegrep -E '^VITE_DD_(RUM_APPLICATION_ID|SITE)=' .env.local, because env files often hold secrets.Check what Product Analytics needs.
- No RUM init: stop before any edit. Tell the user that Product Analytics collects its data through the RUM Browser SDK, that this app has none, and that RUM must be set up first with the
dd-instrument-rumskill. Ask whether to set up RUM now, and close with theblocked: RUM missingsummary below (namingdd-instrument-rumand asking whether to run it) instead of the settings step. On yes, run that skill; when it is not installed, get it from that link or follow the Browser Monitoring setup docs, then restart at step 1, and if there is still no init with an application ID, stop and report it. - Two or more inits, or npm and CDN setups mixed: stop and report each location, because a second init splits sessions between configurations. Repairing that belongs to RUM setup.
- Site
ddog-gov.comorus2.ddog-gov.com: stop and report that Product Analytics is not available on those sites. - No application ID found: ask the user. It is listed under Real User Monitoring > Manage Applications in Datadog.
- No RUM init: stop before any edit. Tell the user that Product Analytics collects its data through the RUM Browser SDK, that this app has none, and that RUM must be set up first with the
Turn Product Analytics on. Check for both keys without printing them:
[ -n "$DD_API_KEY" ] && [ -n "$DD_APP_KEY" ] && echo set. With keys, follow references/api-switch.md: it reads the current state, records whether the application is in preview, and sends onlyproduct_analytics_retention_state: MAX. Without keys, or after a failure, give the user the settings step: in Datadog, open Digital Experience > Real User Monitoring > Manage Applications, select the application, then under PRODUCT SETTINGS click Product Analytics and Enable. BuildAPP_HOSTas described in Verify and view. When the Datadog MCP server has the RUM toolset,Datadog:search_rum_applicationsreportsproduct_analytics_retention_state, which confirms either path.Tie sessions to users.
- The app has sign-in: call
datadogRum.setUser({ id: String(user.id), name: user.name, email: user.email })where the signed-in user first becomes available in the browser: the nearest provider, layout or root component that holds the user, such as auseSession(),useUser()oronAuthStateChangedconsumer, rather than a leaf component.idmust be stable;nameandemailare optional. When the user object has noid, use another stable unique value the app holds for that user, and make no call while it is undefined, becauseString(undefined)i
- The app has sign-in: call
Установить dd-instrument-product-analytics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dd-instrument-product-analytics?
Switches on Datadog Product Analytics (funnels, retention, pathways, user journeys) for a browser app that runs the Datadog RUM Browser SDK. Turns the product on for the app's RUM application, ties sessions to signed-in users with setUser, and checks that events arrive. Use when asked to add, set up, enable or verify Product Analytics or user-behavior analytics in a web frontend. Not for adding RUM itself, which dd-instrument-rum does first, or for mobile apps.
Как установить скилл dd-instrument-product-analytics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dd-instrument-product-analytics запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic