UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

232 lines (186 loc) โ€ข 6.96 kB
# ๐Ÿ“Š Analytics Guide - Query Your Data Effectively ## ๐ŸŽฏ Overview The Optimizely MCP Server provides **14 high-performance analytics views** that let you query your data efficiently. This guide shows you how to use them effectively. ## ๐Ÿ—ƒ๏ธ Available Data Views ### **๐Ÿšฉ Feature Flag Views** | View | Purpose | Common Use Cases | |------|---------|------------------| | **flags_unified_view** | All flags with environment status | "Show me all flags", "Flags by environment" | | **flag_variations_flat** | Flag variation details with variables | "Show variations for flag X" | | **flag_variation_variables** | Individual variable values (one row per variable) | "Find flags with variable Y" | | **flag_variables_summary** | Summary of variables by flag | "Which flags use most variables?" | | **flag_state_history_view** | Flag enable/disable timeline | "When was flag X enabled?" | ### **๐Ÿงช Experiment Views** | View | Purpose | Common Use Cases | |------|---------|------------------| | **experiments_unified_view** | All experiments across platforms | "Show running experiments", "Experiments by project" | | **experiment_audiences_flat** | Experiment-audience relationships | "Which experiments target audience X?" | | **experiment_events_flat** | Experiment metrics/events | "Show experiment conversion events" | | **experiment_pages_flat** | Experiment-page relationships | "Experiments running on page X" | ### **๐ŸŽฏ Targeting & Configuration Views** | View | Purpose | Common Use Cases | |------|---------|------------------| | **audiences_flat** | Audience definitions | "Show all audiences", "Audiences using attribute X" | | **pages_flat** | Page configurations | "Show all pages", "Pages with activation rules" | ### **๐Ÿ“ˆ Analytics & Usage Views** | View | Purpose | Common Use Cases | |------|---------|------------------| | **entity_usage_view** | Cross-entity usage tracking | "Which entities are unused?", "Adoption rates" | | **analytics_summary_view** | High-level analytics summary | "Project overview", "Usage statistics" | | **change_history_flat** | Complete audit log | "Recent changes", "Who changed what?" | ## ๐Ÿ” Query Patterns ### **Basic Data Retrieval** #### **View All Items** ``` "Show me all feature flags" โ†’ Uses: flags_unified_view โ†’ Returns: All flags with basic info ``` #### **Project-Specific Queries** ``` "Show me flags for project 12345" โ†’ Uses: flags_unified_view + project filter โ†’ Returns: Only flags from that project ``` #### **Status Filtering** ``` "Show me enabled flags in production" โ†’ Uses: flags_unified_view + environment + status filters โ†’ Returns: Active flags in production environment ``` ### **Advanced Analytics** #### **Counting and Grouping** ``` "Get the total count of flags for each environment" โ†’ Uses: flags_unified_view + GROUP BY environment โ†’ Returns: Environment โ†’ Flag count mapping ``` #### **Time-Based Analysis** ``` "Show me flags created in the last 30 days" โ†’ Uses: flags_unified_view + date filter โ†’ Returns: Recently created flags ``` #### **Cross-Entity Analysis** ``` "Show me experiments using audience 'mobile_users'" โ†’ Uses: experiment_audiences_flat + audience filter โ†’ Returns: Experiments with that audience ``` ### **Variable and Configuration Queries** #### **Variable Discovery** ``` "Give me a list of flags that have a variable named 'cdnVariationSettings'" โ†’ Uses: flag_variation_variables + variable name filter โ†’ Returns: Flags using that specific variable ``` #### **Usage Analysis** ``` "Show me the usage view for project 12345" โ†’ Uses: entity_usage_view + project filter โ†’ Returns: Adoption and usage statistics ``` ## ๐ŸŽฏ Filtering Techniques ### **Environment Filtering** ``` โœ… "Show flags in production environment" โœ… "Compare staging vs production settings" ``` ### **Status Filtering** ``` โœ… "Show only enabled flags" โœ… "Show only running experiments" โœ… "Show archived items" ``` ### **Date Filtering** ``` โœ… "Show flags created in last 30 days" โœ… "Show recent changes" โœ… "Show items modified this week" ``` ### **Attribute Filtering** ``` โœ… "Show audiences using attribute 'building_type'" โœ… "Show experiments tracking event 'purchase_completed'" ``` ## ๐Ÿ“ˆ Aggregation and Analysis ### **Counting** ``` "Get total count of flags by environment" "Count experiments by status" "How many audiences use each attribute?" ``` ### **Grouping** ``` "Group flags by project and environment" "Show experiments grouped by status" "Group pages by activation type" ``` ### **Performance Analysis** ``` "Show experiment results with statistical significance" "Which flags have the highest adoption?" "What experiments are performing best?" ``` ## ๐Ÿ”ง Advanced Query Techniques ### **Multi-View Analysis** ``` "Show me flags and their associated experiments" โ†’ Combines: flags_unified_view + experiments_unified_view ``` ### **Cross-Project Comparison** ``` "Compare flag usage between project A and B" โ†’ Uses: entity_usage_view + project filters ``` ### **Historical Analysis** ``` "Show flag changes over the last month" โ†’ Uses: change_history_flat + date range ``` ### **Dependency Tracking** ``` "Which experiments depend on audience X?" โ†’ Uses: experiment_audiences_flat + audience filter ``` ## ๐Ÿ’ก Query Optimization Tips ### **1. Be Specific with Projects** ``` โœ… Good: "Show flags for project 12345" โŒ Slow: "Show all flags everywhere" ``` ### **2. Use Appropriate Views** ``` โœ… For flag overview: flags_unified_view โœ… For variable details: flag_variation_variables โœ… For usage stats: entity_usage_view ``` ### **3. Filter Early** ``` โœ… "Show enabled flags in project 12345" โŒ "Show all flags" โ†’ then ask for filtering ``` ### **4. Leverage Pagination** ``` โœ… "Show first 25 flags" โœ… "Get next page of results" ``` ## ๐Ÿš€ Next Steps - **[Export Guide](EXPORT-GUIDE.md)** - Save your analysis results - **[Workflows Guide](WORKFLOWS-GUIDE.md)** - Complete real-world examples - **[Query Reference](QUERY-REFERENCE.md)** - Complete view documentation ## ๐Ÿ“‹ Common Troubleshooting ### **No Results Returned** - Check project ID is correct - Verify filters aren't too restrictive - Try broader query first, then add filters ### **Too Many Results** - Add project filter: "for project X" - Use status filter: "only enabled" or "only running" - Add date filter: "created in last 30 days" ### **Need More Detail** - Ask for specific entity details - Use different view (e.g., variables view for variable info) - Export results for external analysis --- **๐Ÿ’ก Remember**: Start with broad queries, then refine with filters. The system is designed to handle complex analysis efficiently!