Analytics Developer (Smart Router)

Automate analytics event routing to the Anytype iOS analytics system.

509|79|Updated May 26, 2023
One-click install
npx skills add https://github.com/anyproto/anytype-swift --skill analytics-developer-smart-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Analytics Developer (Smart Router)
Source: https://github.com/anyproto/anytype-swift/tree/main/.claude/skills/analytics-developer
Command: npx skills add https://github.com/anyproto/anytype-swift --skill analytics-developer-smart-router

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Context-aware routing to the Anytype iOS analytics system, ensuring consistent event definitions, route tracking, and property keys across the codebase.

Core Features & Use Cases

  • Route Enums & Keys: Enforces route enums in AnalyticsConstants.swift and typed properties for event keys.
  • Event Methods: Centralized analytics methods in AnytypeAnalytics+Events.swift.
  • Practical Tracking: Guides on integrating route context into screen and button analytics.

Quick Start

  1. Define a route enum in AnalyticsConstants.swift (e.g., YourFeatureRoute).
  2. Add a method to AnytypeAnalytics+Events.swift for the new event.
  3. Use AnytypeAnalytics.instance().logYourEvent(...) in your ViewModel or Coordinator.

Frequently Asked Questions about Analytics Developer (Smart Router)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize analytics event routing in my iOS app?

Analytics event routing standardizes how events flow to the Anytype iOS analytics system by enforcing typed route enums in AnalyticsConstants.swift and centralized event methods. This ensures consistent event definitions and property keys across screens, coordinators, and data models throughout your codebase.

What's the best way to track user navigation routes in an iOS app?

Route tracking captures user navigation by defining route enums, applying them through AnytypeAnalytics+Events.swift methods, and passing route context into screen and button analytics. This preserves navigation flow context using .compactMapValues to handle optional properties cleanly.

How do I add route tracking to screens and coordinators?

Define a route enum in AnalyticsConstants.swift, create a method in AnytypeAnalytics+Events.swift for your event, then call AnytypeAnalytics.instance().logYourEvent(...) from your ViewModel or Coordinator, passing route context as a typed parameter instead of string literals.

Why should I avoid string literals for analytics routes?

String literals for routes create inconsistency, typos, and make refactoring difficult. Typed route enums in AnalyticsConstants.swift provide compile-time safety, enable IDE autocomplete, and ensure all route tracking uses the same definitions across screens and data models.

Can I use this approach for multi-space analytics events?

Yes. The Skill applies to multi-space events by using AnalyticsEventsPropertiesKey for event keys and route context across spaces. Define space-specific route enums and apply them through the same centralized AnytypeAnalytics+Events.swift pattern.

What event properties should I track with route context?

Route context combines screen identifiers, coordinator names, and user navigation state. Use AnalyticsEventsPropertiesKey for typed property keys, apply .compactMapValues { $0 } to optional properties, and pass route enums instead of raw strings to preserve the full navigation context in each event.