Implement a comprehensive mobile analytics strategy with structured event tracking, funnel analysis, and privacy-compliant data collection across iOS and Android.
## ROLE You are a mobile analytics architect who has designed event tracking systems processing billions of events per month. You specialize in building analytics layers that provide actionable product insights while respecting user privacy regulations including GDPR, CCPA, and ATT framework requirements. ## OBJECTIVE Design and implement a complete analytics tracking system for a [APP_TYPE: SaaS/marketplace/gaming/health/education] mobile application. The system must capture user behavior at every meaningful touchpoint, support A/B testing, and generate dashboards that drive product decisions for [TEAM_SIZE] team members. ## TASK ### Step 1: Event Taxonomy Design Create a structured event naming convention and taxonomy: - Naming pattern: [object]_[action] (e.g., product_viewed, cart_item_added, checkout_completed) - Event categories: Navigation, Engagement, Transaction, Error, System, [CUSTOM_CATEGORY] - Required properties for every event: timestamp, session_id, user_id, platform, app_version, screen_name - Category-specific properties (e.g., transaction events include currency, amount, payment_method) - Property validation rules and type definitions - Event versioning strategy for schema evolution without breaking dashboards - Document at least [NUMBER_OF_EVENTS: 30-50] core events covering the complete user journey ### Step 2: Analytics SDK Integration Implement the tracking layer: - Primary analytics provider: [PROVIDER: Amplitude/Mixpanel/Firebase Analytics/PostHog] - SDK initialization with configuration for [ENVIRONMENT: development/staging/production] - Event batching and offline queuing for reliable delivery - User identification and anonymous-to-identified user merging - Super properties / user properties that persist across sessions - Group analytics for [B2B_ENTITY: organization/team/workspace] if applicable - Cross-platform identity resolution between iOS and Android ### Step 3: Funnel & Conversion Tracking Define critical conversion funnels: - Onboarding funnel: app_open -> signup_started -> signup_completed -> onboarding_step_[N] -> first_value_moment - Purchase funnel: product_viewed -> cart_opened -> checkout_started -> payment_submitted -> order_confirmed - Engagement funnel: [DEFINE_YOUR_ENGAGEMENT_FUNNEL] - Retention triggers: identify [NUMBER] key actions that predict 30-day retention - Drop-off alerting thresholds for each funnel stage - Cohort definitions for behavioral segmentation ### Step 4: A/B Testing Infrastructure Build the experimentation framework: - Feature flag system integration with [PROVIDER: LaunchDarkly/Firebase Remote Config/Statsig/custom] - Experiment assignment logging with variant tracking - Statistical significance calculation parameters (confidence level, MDE, sample size) - Guardrail metrics to detect negative impacts on [CRITICAL_METRICS] - Experiment result event schema for automated analysis - Mutual exclusion groups for overlapping experiments ### Step 5: Privacy & Consent Management Implement privacy-compliant tracking: - Consent management flow with granular opt-in/opt-out for analytics categories - Apple ATT (App Tracking Transparency) prompt timing and copy strategy - GDPR-compliant data collection with purpose limitation - Data retention policies: [RETENTION_PERIOD] for raw events, [RETENTION_PERIOD] for aggregates - User data deletion API for right-to-erasure requests - Server-side event validation to strip PII before storage - Privacy-preserving analytics alternatives for opted-out users ### Step 6: Dashboard & Alerting Design the analytics dashboard system: - Executive dashboard: DAU/MAU, revenue, retention curves, acquisition channels - Product dashboard: feature adoption, session duration, screen flow analysis - Engineering dashboard: crash rates, API latency, error rates by endpoint - Alert configuration for anomaly detection on [KEY_METRICS] - Automated weekly report generation for [STAKEHOLDERS] - Self-serve exploration interface for product managers ### Step 7: Implementation Code Provide the tracking wrapper code: - Analytics manager singleton with provider abstraction - Type-safe event builders using enums and typed dictionaries - Middleware for automatic screen view tracking - Network request performance tracking interceptor - Crash and ANR event capture integration - Debug mode with event console logger for development Include the complete event taxonomy spreadsheet template and implementation code for both iOS (Swift) and Android (Kotlin).
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[TEAM_SIZE][CUSTOM_CATEGORY][N][DEFINE_YOUR_ENGAGEMENT_FUNNEL][NUMBER][CRITICAL_METRICS][RETENTION_PERIOD][KEY_METRICS][STAKEHOLDERS]