### Quick Start: Clasp Installation and Project Setup Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md A streamlined 5-command process to install clasp, log in, create a new Apps Script project for Google Sheets, push initial files, and open the project. This is a rapid setup guide for new projects. ```bash # 1. Install clasp (one-time) npm install -g @google/clasp # 2. Login (one-time) clasp login # 3. Create project cd /Users/ocho-air/Documents/GitHub/tracking-sheet-project clasp create --title "Gym Ops V2.2" --type sheets # 4. Push all files clasp push # 5. Open clasp open ``` -------------------------------- ### Install Node.js and clasp CLI Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md This snippet covers the initial setup required before using CLASP. It includes checking for an existing Node.js installation and installing the CLASP CLI globally using npm. ```bash # Check if you have Node.js node --version # If not installed, download from: # https://nodejs.org/ (LTS version) ``` ```bash npm install -g @google/clasp ``` -------------------------------- ### Implement Enhanced Quick Start Wizard Logic (JavaScript) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/ONBOARDING-UX-IMPROVEMENT-PLAN.md This JavaScript function outlines the steps for an enhanced quick start wizard. It includes new steps for marketing budget setup, staff customization, and sample data generation. The function is designed to guide new users through a more comprehensive initial setup process. ```javascript function quickStartWizard() { // Step 1: Welcome & Auto-Initialize // Step 2: Gym Name // Step 3: Monthly New Member Goal // Step 4: ⭐ MARKETING BUDGET (NEW) // - Show list of 11 sources // - Ask for monthly spend per source // - Pre-populate Settings & Budget (row 40+) // - Auto-generate daily spend // Step 5: Staff & Membership Types // - Customize default staff names // - Customize membership package types // Step 6: Sample Data (optional) // - Add 50 realistic leads for testing } ``` -------------------------------- ### Welcome Screen Modal Design (UI Mockup) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/UX-IMPROVEMENTS-ANALYSIS.md A conceptual design for a welcome modal presented to first-time users of the 'Gym Ops Tracker'. It offers options for a quick start wizard, video tutorial, sample data, or skipping the introduction. This aims to reduce setup anxiety and guide new users. ```Text ┌─────────────────────────────────────────┐ │ Welcome to Gym Ops Tracker! 🏋️‍♂️ │ ├─────────────────────────────────────────┤ │ │ │ Let's get you set up in 5 minutes! │ │ │ │ [▶️ Run Quick Start Wizard] │ │ [📖 View Video Tutorial] │ │ [🧪 Load Sample Data] │ │ [❌ Skip - I'll explore myself] │ │ │ └─────────────────────────────────────────┘ ``` -------------------------------- ### Implement Quick Start Wizard in Google Apps Script Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/IMPROVEMENTS.md This Google Apps Script function, quickStartWizard, guides new users through the initial setup of the tracking sheet. It prompts for essential information like gym name and monthly targets, applies these settings, and offers to add sample data. It uses the SpreadsheetApp and Ui services for user interaction and spreadsheet manipulation. Dependencies include the SpreadsheetApp service and a helper function addSampleData (not provided). ```javascript function quickStartWizard() { const ui = SpreadsheetApp.getUi(); // Step 1: Welcome ui.alert( '👋 Welcome to Gym Ops!', 'This 2-minute wizard will customize the template for your gym.\n\nClick OK to continue.', ui.ButtonSet.OK ); // Step 2: Gym Name const gymName = ui.prompt( 'Step 1 of 4: Gym Name', 'What\'s your gym name?', ui.ButtonSet.OK_CANCEL ); if (gymName.getSelectedButton() !== ui.Button.OK) return; // Step 3: Monthly Target const targetMembers = ui.prompt( 'Step 2 of 4: Monthly Goal', 'How many new members do you want per month? (e.g., 40)', ui.ButtonSet.OK_CANCEL ); if (targetMembers.getSelectedButton() !== ui.Button.OK) return; // Step 4: Lead Sources const result = ui.alert( 'Step 3 of 4: Lead Sources', 'Default sources:\n• Facebook\n• Instagram\n• Google\n• Referral\n• Walk-in\n\nKeep defaults?', ui.ButtonSet.YES_NO ); // Step 5: Sample Data const sampleData = ui.alert( 'Step 4 of 4: Sample Data', 'Add 20 sample leads to test the system?\n(You can delete them later)', ui.ButtonSet.YES_NO ); // Apply settings const ss = SpreadsheetApp.getActiveSpreadsheet(); ss.rename(gymName.getResponseText() + ' - Gym Ops Tracker'); ss.getSheetByName('Settings').getRange('B6').setValue(Number(targetMembers.getResponseText())); if (sampleData === ui.Button.YES) { addSampleData(); } // Done! ui.alert( '✅ Setup Complete!', 'Your gym operations tracker is ready.\n\nNext steps:\n1. Check the DASHBOARD tab\n2. Add your first lead in \"Lead Data\"\n3. Review Settings tab', ui.ButtonSet.OK ); // Jump to Dashboard ss.setActiveSheet(ss.getSheetByName('DASHBOARD')); } ``` -------------------------------- ### Production Deployment Commands with Clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md A sequence of clasp commands for deploying code to production. Includes creating a version tag, pushing the latest changes, and opening the deployed web app for testing. ```bash # Create version clasp version "v2.2 production" # Deploy clasp push # Test clasp open --webapp ``` -------------------------------- ### Open Apps Script Project and Sheet with clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md These commands provide quick access to the Apps Script editor and the associated Google Sheet directly from the command line using CLASP. ```bash clasp open ``` ```bash clasp open --webapp ``` -------------------------------- ### Deployment Commands Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/IMPLEMENTATION-COMPLETE.md This bash script outlines the steps to deploy the tracking sheet project to a new gym. It involves distributing the Apps Script code and configuration file, guiding the user through setup documentation, and running the Quick Start Wizard for automated customization. Finally, it details initial team training and going live. ```bash 1. Send them: Code.gs + appsscript.json 2. They follow: SETUP.md (5 minutes) 3. Run: Quick Start Wizard (2 minutes) 4. Customize: Settings tab (5 minutes) 5. Train team: Front desk (10 min), Sales (15 min), Manager (5 min) 6. Go live: Start entering leads ``` -------------------------------- ### Force Push with Clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md Resolves 'Push failed' errors by performing a force push using the clasp command-line tool. Ensure you understand the implications of force pushing before use. ```bash # Solution: Force push clasp push --force ``` -------------------------------- ### Common clasp Commands Cheat Sheet Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md A collection of frequently used CLASP commands for managing Apps Script projects, including creating, pushing, pulling, watching for changes, opening editors, deploying, and managing versions. ```bash # Create new project clasp create --title "Project Name" --type sheets # Push all changes clasp push # Pull remote changes clasp pull # Watch for changes (auto-push) clasp push --watch # Open Apps Script editor clasp open # Open the spreadsheet clasp open --webapp # Deploy as web app clasp deploy # List deployments clasp deployments # Create version clasp version "v2.2 release" # View logs clasp logs # Run function clasp run functionName ``` -------------------------------- ### Team Collaboration Workflow with Git and Clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md A workflow for team collaboration that involves pushing changes to a Git repository, pulling updates, and then deploying using clasp. This ensures version control and facilitates coordinated development. ```bash # 1. Developer pushes to Git git push origin main # 2. Team member pulls git pull # 3. Team member deploys clasp push ``` -------------------------------- ### Quick Start Wizard Implementation in Google Apps Script Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/ONBOARDING-UX-IMPROVEMENTS-COMPLETE.md This describes the comprehensive rewrite of the `quickStartWizard` function in `Code.gs`. It details the 6-step wizard that guides users through setting up their gym tracking sheet, including budget, staff, and membership types configuration. ```javascript // Files Modified: // - `Code.gs` lines 125-296 (quickStartWizard function - completely rewritten) // Change Description: // ✅ Complete rewrite: 6-step wizard with budget/staff/types ``` -------------------------------- ### Create a New Apps Script Project and Link to Existing Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md This method involves creating a new Apps Script project with CLASP, pushing the initial files, and then manually updating the existing sheet's Apps Script configuration with the new script ID. ```bash # Create new Apps Script project clasp create --title "Gym Ops V2.2" --type standalone # Push files clasp push # Manually copy script ID # Go to existing sheet → Extensions → Apps Script # Replace the container with new script ID ``` -------------------------------- ### Update Initialization Function (JavaScript) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/SINGLE-FILE-INSTALLATION.md This JavaScript code illustrates how to update the `initializeTemplateV2` function to include newly added custom tabs. It shows where to insert calls to your custom tab creation functions within the existing initialization process. ```javascript function initializeTemplateV2(silent) { // ... existing code ... try { // Add your tabs here: createMembersTabV2(ss); createDashboardTabV2(ss); createMyTabV2(ss); // Your custom tab ui.alert('✅ Done!', 'Template initialized!', ui.ButtonSet.OK); } catch (error) { ui.alert('❌ Error', error.toString(), ui.ButtonSet.OK); } } ``` -------------------------------- ### Create and Deploy a New Apps Script Project with clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md This section demonstrates how to create a new Apps Script project, configure it to ignore specific files using .claspignore, and push all project files to the Google Apps Script environment. ```bash cd /Users/ocho-air/Documents/GitHub/tracking-sheet-project clasp create --title "Gym Ops Tracker V2.2" --type sheets ``` ```bash # Create file to exclude documentation cat > .claspignore << 'EOF' **/** !*.gs !appsscript.json EOF ``` ```bash clasp push ``` -------------------------------- ### Clone an Existing Apps Script Project with clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md This process involves cloning an existing Apps Script project using its Script ID, copying local files into the cloned directory, and then pushing the updates. ```bash # Get your script ID from: # Extensions → Apps Script → Project Settings → Script ID clasp clone # Copy your new files to the cloned directory cp *.gs /path/to/cloned/directory/ # Push updates clasp push ``` -------------------------------- ### Re-login with Clasp Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md Addresses 'No credentials found' errors by initiating a re-login process with the clasp command-line tool. This refreshes authentication tokens. ```bash # Solution: Re-login clasp login ``` -------------------------------- ### Troubleshooting clasp 'command not found' Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md This section provides solutions for the common 'clasp: command not found' error, suggesting either reinstalling the CLASP package globally or using npx to execute the command. ```bash # Solution 1: Reinstall globally npm install -g @google/clasp # Solution 2: Use npx npx @google/clasp push ``` -------------------------------- ### Add Members Tab Function (JavaScript) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/SINGLE-FILE-INSTALLATION.md This JavaScript function demonstrates how to add a 'Members' tab using the TabBuilder and FormulaBuilder classes. It's an example of extending the core functionality by adding specific tab creation logic to the end of the main script file. ```javascript // Add at the end of gym-ops-v2.2-COMPLETE.gs: function createMembersTabV2(ss) { new TabBuilder(ss, 'Members') .create() .addFormula(1, 'A', FormulaBuilder.activeMembersFilter()) .setFrozen({ rows: 1, columns: 4 }) .build(); } // Add more tab functions as needed... ``` -------------------------------- ### Single File Approach for Apps Script Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md Combines multiple Google Apps Script files into a single 'master-bundle.gs' file for simpler deployments. This method consolidates foundation, refactored tabs, features, and testing code into one file, with 'constants.gs' kept separate. ```javascript // ============================================================ // FOUNDATION: TabBuilder // ============================================================ class TabBuilder { // ... paste entire tabBuilder.gs content ... } // ============================================================ // FOUNDATION: FormulaBuilder // ============================================================ var FormulaBuilder = { // ... paste entire formulaBuilder.gs content ... }; // ============================================================ // FOUNDATION: ValidationService // ============================================================ var ValidationService = (function() { // ... paste entire validationService.gs content ... })(); // ============================================================ // REFACTORED TABS: Members, _Data, _Metrics, etc. // ============================================================ function createMembersTabV2(ss) { // ... paste from tabs-refactored.gs ... } function createDataTabV2(ss) { // ... paste from tabs-refactored.gs ... } // ... paste all other functions ... // ============================================================ // FEATURES: Member Type Toggle // ============================================================ function createMembersTabV2WithToggle(ss) { // ... paste from member-type-toggle.gs ... } // ============================================================ // FEATURES: Performance Optimizations // ============================================================ var PerformanceConfig = { // ... paste from performance-optimizations.gs ... }; // ============================================================ // TESTING: Test Harness // ============================================================ function testAll() { // ... paste from test-harness.gs ... } // ============================================================ // INITIALIZATION // ============================================================ function initializeTemplateV2(silent) { // ... paste from initialize-v2.gs ... } ``` -------------------------------- ### Development Workflow with Clasp Watch Mode Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/INSTALLATION-CLASP-GUIDE.md Utilizes clasp's watch mode for continuous synchronization between local development (e.g., in VS Code) and Google Apps Script. Edits are automatically synced, providing instant updates for faster development cycles. ```bash # Use clasp with watch mode clasp push --watch ``` -------------------------------- ### Migration Guide Content for v2.1-beta to v2.5-simple Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/STRATEGIC-SIMPLIFICATION-PLAN.md This markdown content serves as a migration guide for users transitioning from Gym Ops Tracker version 2.1-beta to version 2.5-simple. It outlines the necessary steps and considerations for migrating data and settings between these versions. This guide is intended for existing users of the Gym Ops Tracker. ```markdown # 🔄 Migration Guide: v2.1-beta → v2.5-simple ``` -------------------------------- ### Apps Script Initialization and Tab Creation Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/IMPLEMENTATION-COMPLETE.md This Apps Script code handles the initial setup of the tracking sheet. It creates custom menus, runs a quick start wizard for interactive setup, initializes all necessary tabs (Dashboard, Lead Data, Members, Settings, Marketing, Staff, Help, Data), and configures named ranges, data validations, charts, tab order, and sample data. It avoids using onEdit or time-driven triggers, relying on formulas instead. ```javascript // MENU & INITIALIZATION (lines 1-140) // MENU & INITIALIZATION (lines 1-140) function onOpen() { // Creates "Gym Ops" menu // Implementation details omitted for brevity } function quickStartWizard() { // 4-step interactive setup // Implementation details omitted for brevity } function initializeTemplate() { // Creates all 8 tabs // Implementation details omitted for brevity } // TAB CREATION (lines 141-550) function createDashboardTab() { // Unified dashboard // Implementation details omitted for brevity } function createLeadDataTab() { // 25-column entry // Implementation details omitted for brevity } function createMembersTab() { // Filtered view // Implementation details omitted for brevity } function createSettingsTab() { // Unified config // Implementation details omitted for brevity } function createMarketingTab() { // Spend + performance // Implementation details omitted for brevity } function createStaffTab() { // Leaderboard // Implementation details omitted for brevity } function createHelpTab() { // Quick guide // Implementation details omitted for brevity } function createDataTab() { // Hidden calculations // Implementation details omitted for brevity } // SETUP FUNCTIONS (lines 551-640) function createNamedRanges() { // rngStart, rngEnd, rngAsOf // Implementation details omitted for brevity } function setupDataValidations() { // Dropdowns // Implementation details omitted for brevity } function createAllCharts() { // Auto-positioned charts // Implementation details omitted for brevity } function reorderTabs() { // Correct tab order // Implementation details omitted for brevity } function refreshDashboards() { // Force recalc // Implementation details omitted for brevity } function addSampleData() { // 20 test leads // Implementation details omitted for brevity } function testScript() { // Verify setup // Implementation details omitted for brevity } ``` -------------------------------- ### Test Example Regression Source: https://github.com/ochodev/tracking-sheet-project/blob/main/docs/TESTING-GUIDE.md Demonstrates a regression testing scenario where a specific change to the spend formula is made, and then potentially affected and unrelated features are tested to ensure no unintended side effects occurred. ```Markdown Changed: Spend formula (DASHBOARD G20) Potentially Affected: - CPL (H20) ✓ Test - CPA (I20) ✓ Test - CPS (J20) ✓ Test - CAC (K20) ✓ Test - LTV:CAC (M20) ✓ Test Unrelated Spot Checks: - Members tab ✓ Test - Lead Data dropdowns ✓ Test - Date range ✓ Test ``` -------------------------------- ### Test Performance Optimization Features Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/FEATURE-ENHANCEMENTS-GUIDE.md Provides example calls to test various aspects of the performance optimization features. This includes viewing stats, running manual optimization, and simulating performance with a large dataset. ```javascript // View current stats showPerformanceStats() // Run optimizationoptimizeSheetPerformance() // Test with large dataset (simulated) testPerformanceWithLargeDataset() ``` -------------------------------- ### Add Quick Start Wizard to Custom Menu Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/IMPROVEMENTS.md This JavaScript code snippet demonstrates how to add a custom menu item to a Google Sheet that triggers the 'quickStartWizard' function. This allows users to easily access the setup wizard directly from the spreadsheet interface. It requires the SpreadsheetApp service and assumes the 'quickStartWizard' function is defined elsewhere. ```javascript .addItem('🧙 Quick Start Wizard', 'quickStartWizard') ``` -------------------------------- ### Staff Setup Prompt in Google Apps Script Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/ONBOARDING-UX-IMPROVEMENT-PLAN.md Implements a prompt within the setup wizard to collect staff names. The entered names are parsed, trimmed, and intended for population into the 'Settings' tab of the spreadsheet. ```javascript // Step 5: Staff Setup const staffPrompt = ui.prompt( 'Step 5 of 6: Staff Names', 'Enter staff names (comma-separated):\n\nExample: Sarah, Mike, Jessica', ui.ButtonSet.OK_CANCEL ); // Parse and populate Settings!B14:B16 const staffNames = staffPrompt.getResponseText().split(',').map(s => s.trim()); ``` -------------------------------- ### README.md Content for Gym Ops Tracker v2.5 Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/STRATEGIC-SIMPLIFICATION-PLAN.md This markdown content is intended for the README.md file of Gym Ops Tracker v2.5. It details the version differences, setup instructions, features, target audience, daily workflow, and version history. This file serves as a comprehensive guide for users of the software. ```markdown # 🏋️ Gym Ops Tracker v2.5 - Simple Edition **Tagline:** Track leads and members without the complexity --- ## ✨ What Makes v2.5 Different **From v2.1-beta:** - ❌ Removed 6 advanced tabs (LTV, Metrics, Role Views) - ❌ Removed 5 of 7 charts (kept funnel + trend) - ❌ Removed 4 hidden calculation tabs - ❌ Removed protections (visual cues instead) - ✅ Kept all error handling and validation - ✅ Kept backup/restore, export, dark mode - ✅ 74% less code (4,560 → 1,200 lines) - ✅ 67% faster (60s → 15s initialization) **Philosophy:** Simple > Comprehensive --- ## 🚀 5-Minute Setup 1. Create new Google Sheet 2. Extensions → Apps Script 3. Copy `Code.gs` → Paste → Save 4. Refresh sheet (F5) 5. Gym Ops → Quick Start Wizard 6. Done! ✅ --- ## 📊 Tabs (8 Total) 1. **DASHBOARD** - One-page morning check 2. **Lead Data** - Enter leads (26 columns) 3. **Members** - Active members view 4. **Settings** - Config + UTM mapping 5. **Marketing** - Monthly spend input 6. **Staff** - Leaderboard 7. **Help** - Quick instructions 8. **_Data** - Hidden (active members calc) --- ## 💪 What You Get **Core Tracking:** - Lead capture (26 fields) - Funnel metrics (Set → Show → Close) - Active member tracking - Monthly targets & on-pace status **Quality Features:** - Duplicate detection (phone/email) - Date validation (prevents errors) - Quick Add Lead dialog - Backup/Restore - CSV Export - Dark Mode **GHL Integration:** - UTM tracking (automatic source mapping) - Workflow setup (see Help tab) --- ## 📈 Who Is This For? **Perfect for:** - ✅ Small gyms (<5,000 leads) - ✅ Single location operations - ✅ Core tracking needs - ✅ Users who value simplicity **Not for:** - ❌ Large chains (10,000+ leads) - ❌ Advanced analytics needs (use v2.1-beta) - ❌ Complex multi-location setups --- ## 🎯 Daily Workflow (10 min/day) **Morning:** 1. Open DASHBOARD 2. Check action items 3. Follow up on leads **Throughout Day:** 1. Add new leads (Quick Add or Lead Data tab) 2. Check boxes: Appt Set → Show → Converted **Weekly:** 1. Add Marketing spend (Marketing tab) 2. Review Staff leaderboard --- ## 📊 Success After 30 Days - ✅ Clear funnel visibility - ✅ Daily action items completed - ✅ Data-driven decisions - ✅ Consistent lead tracking --- ## 🆘 Support **Documentation:** - Quick Help: Gym Ops → View Help - Full Guide: See project folder **Common Issues:** - Menu missing: Wait 20 sec, refresh (F5) - Formulas error: Run Initialize Template - Zeros on dashboard: Check date range --- ## 🔄 Version History - **v2.5-simple** (Oct 2025) - Simplified to 1,200 lines - **v2.1-beta** (Oct 2025) - Enterprise features, 4,560 lines - **v2.0** (Sept 2025) - Original simplified vision - **v1.0** (Original) - 16 tabs, complex --- **Built for operators who need tracking, not complexity.** 💪📊 ``` -------------------------------- ### README.md Update Example Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/IMPLEMENTATION-PLAN.md An example of updating the README.md file to reflect recent successful implementation of formula fixes and sheet improvements. It highlights key functionalities that are now operational. ```markdown ## Recent Updates (2025-10-08) All formula errors have been resolved! The sheet is fully functional: - ✅ DASHBOARD metrics calculating correctly - ✅ LTV Analysis operational - ✅ Enhanced stability with named ranges - ✅ Protected formulas prevent accidents See FORMULA-AUDIT-REPORT.md for complete details. ``` -------------------------------- ### Add Custom Tab Function (JavaScript) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/SINGLE-FILE-INSTALLATION.md This JavaScript snippet shows how to define a new custom tab named 'MyTab' using the TabBuilder class. It includes adding a header, a row with specific content, and setting frozen rows, intended to be appended to the main script file. ```javascript // ═══════════════════════════════════════════ // YOUR CUSTOM TABS // ═══════════════════════════════════════════ function createMyTabV2(ss) { new TabBuilder(ss, 'MyTab') .create() .addHeader('My Custom Tab', 16) .addRow(2, 'A', 'Hello World!') .setFrozen({ rows: 1 }) .build(); } ``` -------------------------------- ### Context-Aware Help Tooltip Example Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/UX-IMPROVEMENTS-ANALYSIS.md Demonstrates the concept of context-aware help tooltips within a tracking sheet. Small question mark icons are placed next to complex fields, and hovering or clicking them reveals a tooltip with a concise explanation or definition, aiding user understanding and reducing the need for external help documentation. ```text Lead Score [?] → Tooltip: "🔥 HOT = 70+, 🟡 Warm = 40-69, 🔵 Cold = <40" Action Needed [?] → Tooltip: "Next best action based on lead status" LTV:CAC [?] → Tooltip: "Target: 3x+ is healthy, 5x+ is excellent" ``` -------------------------------- ### Troubleshoot Empty Marketing Budget Source: https://github.com/ochodev/tracking-sheet-project/blob/main/docs/TROUBLESHOOTING.md This section outlines the steps to resolve issues where the 'SOURCE ANALYSIS' columns show $0 or are blank, primarily focusing on the 'Marketing Budget' setup. It includes conditions for when the budget table is empty and when it has data but spend is still zero. ```pseudocode IF Marketing Budget is empty: 1. Enter months in column A (format: YYYY-MM) 2. Enter source names in column B (from A14:A24) 3. Enter monthly budget in column C 4. Columns D-E auto-calculate IF Budget has data but Spend still $0: 1. Run: Gym Ops → Validate & Auto-Fix 2. Check error messages 3. Verify formula in DASHBOARD G20 4. Verify date range in Settings B30/B31 ``` -------------------------------- ### Example Marketing Budget Configuration Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/QUICK-FIX-DEPLOYMENT.md An example table demonstrating how to configure marketing budget data in the 'Settings & Budget' tab of the Google Sheet. This data is crucial for accurate Spend calculations on the DASHBOARD tab. The columns include Month, Source, Budget, Days in Month, and Daily Rate. ```plaintext Month Source Budget Days Daily Rate 2024-10 Paid Social $2,400.00 31 $77.42 2024-11 Paid Social $2,400.00 30 $80.00 ``` -------------------------------- ### Configuration-Driven Spreadsheet Setup Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/FUNCTION-INVENTORY.md A JavaScript object, tabConfig, defines the structure and properties of different spreadsheet tabs declaratively. A function, initializeTemplate, iterates over this configuration to dynamically create and set up each tab, promoting a more maintainable and adaptable setup process. ```javascript const tabConfig = { DASHBOARD: { order: 1, color: '#4285f4', sections: [...] }, 'Lead Data': { order: 2, color: '#0f9d58', columns: [...] }, Members: { order: 3, color: '#f4b400', filter: {...} }, // ... }; function initializeTemplate() { Object.entries(tabConfig).forEach(([name, config]) => { createTabFromConfig(name, config); }); } ``` -------------------------------- ### Google Apps Script for Gym Ops Tracker Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/SETUP.md This snippet represents the core Apps Script code for the Gym Ops Tracker v2.0. It's designed to be pasted directly into the Google Apps Script editor associated with your Google Sheet. No external libraries are required, but authorization will be needed for it to interact with your Google Sheet data. ```javascript // This is a placeholder for the actual Apps Script code. // The user is instructed to copy the entire Code.gs file from the repository. // Example structure: function onOpen() { // Add custom menu var ui = SpreadsheetApp.getUi(); ui.createMenu('Gym Ops') .addItem('🧙 Quick Start Wizard', 'showSidebar') .addToUi(); } function showSidebar() { var html = HtmlService.createHtmlOutputFromFile('Sidebar') .setTitle('Quick Start Wizard'); SpreadsheetApp.getUi().showSidebar(html); } // ... other functions for data processing, menu interactions, etc. ``` -------------------------------- ### Create Backup and Working Branch - Bash Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/STRATEGIC-SIMPLIFICATION-PLAN.md This bash script creates a backup of the current codebase (Code.gs) before starting modifications. It then creates a new working copy for the simplified version and logs the initial line count of the original file for baseline comparison. This ensures a rollback point and documentation of the starting state. ```bash # Save current version cp Code.gs Code.gs.v2.1-beta.backup echo "v2.1-beta backup created on $(date)" >> BACKUP-LOG.md # Create new working version cp Code.gs Code.gs.v2.5-simple.wip # Document current stats wc -l Code.gs >> SIMPLIFICATION-BASELINE.md ``` -------------------------------- ### CHANGELOG.md Update Example Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/IMPLEMENTATION-PLAN.md An example of how to update the CHANGELOG.md file after implementing formula fixes and other changes. It details fixed, added, and changed items, along with technical implementation details and audit dates. ```markdown ## [2025-10-08] Formula Fix Implementation ### Fixed - DASHBOARD Target column (C10-C16) now displays numeric values - Goal To Date calculations functional (D10-D16) - Variance calculations working (E10-E16) - Status indicators displaying correctly (F10-F16) - LTV Analysis #REF! errors resolved - LTV calculations showing correct values ### Added - Named ranges for all target values - Data validation on numeric fields - Protection on formula cells - Health status indicator - Cell documentation notes - Maintenance checklist tab ### Changed - Updated formulas to use named ranges - Enhanced Apps Script compatibility - Improved error handling ### Technical Details - Phase 1: Direct reference fix (B2 → B3-B9) - Phase 2: [Describe specific LTV fixes made] - Phase 3: Named ranges and protections ``` -------------------------------- ### Update Quick Start Wizard Instructions Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/DAILY-SPEND-UPDATE-PLAN.md Modifies the multi-line string used in the Quick Start Wizard to provide updated instructions. The primary change is updating the reference from the 'Marketing' tab to the 'Settings & Budget' tab and adding a row reference. This affects user guidance within the application. ```javascript 'Next steps:\n' + '1. Go to Marketing tab and add monthly budgets\n' + '2. Run "Gym Ops → Generate Daily Spend"\n' + '3. Check DASHBOARD to see metrics and Source Analysis\n\n' + 'Note: Source column will auto-fill based on UTM mapping.', ``` ```javascript 'Next steps:\n' + '1. Go to Settings & Budget tab (row 40+) and add monthly budgets\n' + '2. Run "Gym Ops → Generate Daily Spend"\n' + '3. Check DASHBOARD to see metrics and Source Analysis\n\n' + 'Note: Source column will auto-fill based on UTM mapping.', ``` -------------------------------- ### Update Existing Project with Clasp CLI Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/DEPLOYMENT-GUIDE-V2.md This snippet demonstrates how to update an existing Google Apps Script project with new and modified files using the clasp CLI. It assumes clasp is installed and authenticated. Ensure you replace `` with your project's actual script ID and `` with the path to your local project directory. This method facilitates version control and streamlined updates. ```bash # Clone your existing project clasp clone # Add new files cp tabBuilder.gs / cp formulaBuilder.gs / cp validationService.gs / cp tabs-refactored.gs / cp lead-data-refactored.gs / cp help-tab-refactored.gs / cp dashboard-refactored.gs / cp initialize-v2.gs / cp test-harness.gs / # Update existing files cp Code.gs / # With bug fixes cp appsscript.json / # Updated # Push to Google clasp push ``` -------------------------------- ### Priority Matrix Example (Shell Script) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/formulas/FORMULA-AUDIT-INDEX.md Illustrates a hierarchical breakdown of tasks based on priority and estimated effort. This example uses a pseudo-code structure to represent task dependencies and recommended sequencing. ```shell HIGH PRIORITY, QUICK WIN: ├─ Issue #1: Fix Target Column (5 min) ← START HERE └─ Verify Issues #2-4 auto-fix (2 min) HIGH PRIORITY, MORE TIME: ├─ Issue #5: Investigate LTV #REF! (60-90 min) └─ Issue #6: Fix LTV Zeros (30-60 min) MEDIUM PRIORITY: └─ Issue #7: Address Churn Data (20-30 min) LOW PRIORITY (PREVENTION): └─ Phase 3: Stability Improvements (1-2 hours) Recommendation: Do Phase 1 now (5 min), Phase 2 today (2-3 hours), Phase 3 this week (1-2 hours) ``` -------------------------------- ### Smart Auto-Complete Example Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/UX-IMPROVEMENTS-ANALYSIS.md Illustrates the functionality of smart auto-complete for common data entries in a tracking sheet. As a user types, the system suggests relevant options for fields like staff names, lead sources, or cancellation reasons, improving data entry speed and consistency. ```text User types: "Em" → Auto-suggests "Emily (Sales)" User types: "P" → Auto-suggests "Paid Search" User types: "P" → Auto-suggests "Price Too High" ``` -------------------------------- ### Retention & Churn Metrics Example (Spreadsheet) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/LTV-SYSTEM-IMPLEMENTATION.md An example of the Retention & Churn metrics table shown in the DASHBOARD section, providing a snapshot of key performance indicators for the last 30 days. It includes Overall Churn Rate, Average Member Lifespan, Active Members, recent cancellations, and the highlighted Overall Average LTV. ```spreadsheet Metric | Value Overall Churn Rate | 3.5% Avg Member Lifespan | 16.2 months Active Members | 142 Cancelled (Last 30d) | 5 OVERALL AVERAGE LTV | $2,650 (highlighted) ``` -------------------------------- ### LTV by Source Table Example (Spreadsheet) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/LTV-SYSTEM-IMPLEMENTATION.md An example of the LTV by Source table displayed in the DASHBOARD section. It shows key metrics like Average LTV, LTV:CAC ratio, total members, and retention percentage for different marketing sources. The table highlights LTV in green and LTV:CAC in yellow, with '∞' indicating zero Customer Acquisition Cost (CAC). ```spreadsheet Source | Avg LTV | LTV:CAC | Total Members | Retention % Paid Search | $2,800 | 18.7x | 45 | 82.3% Member Referral | $3,200 | ∞ | 23 | 91.2% Paid Social | $2,400 | 12.0x | 38 | 75.0% ``` -------------------------------- ### LTV Assumptions Table Example (Spreadsheet) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/LTV-SYSTEM-IMPLEMENTATION.md An example of the LTV Assumptions table located in the Settings tab. This table defines default values for Expected Lifespan and Expected Churn Rate for different Package Types. These assumptions are used for LTV calculations for active members and can be customized based on historical gym data. ```spreadsheet Package Type | Expected Lifespan (months) | Expected Churn Rate (%) PT | 12 | 8.3% Small Group | 18 | 5.6% General | 18 | 5.6% Class Pack | 6 | 16.7% ``` -------------------------------- ### Optimize Formula Performance (Text Example) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/QUICK-REFERENCE.md This example illustrates how to improve formula performance by bounding ARRAYFORMULA ranges. It contrasts a slow, unbounded formula with a faster, bounded version, advising developers to add limits like ':5000' to existing unbounded formulas. ```text // ❌ BAD: Unbounded (slow) '=ARRAYFORMULA(IF(A2:A="",",...))' // ✅ GOOD: Bounded (fast) '=ARRAYFORMULA(IF(A2:A5000="",",...))' // Find all unbounded formulas and add :5000 limit ``` -------------------------------- ### Example Data Entry for Marketing Budget Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/progress-updates/COMPREHENSIVE-SHEET-REVIEW-REPORT.md This example demonstrates how to input monthly marketing budget data into the 'Settings & Budget' tab. It specifies the required columns: a date range (e.g., '2024-09'), the marketing channel (e.g., 'Paid Search'), and the corresponding monthly budget (e.g., '$2,000'). Columns D and E are expected to auto-calculate. ```text 2024-09: Paid Search | $2,000 2024-10: Paid Social | $1,500 2024-10: Direct Traffic | $500 ``` -------------------------------- ### Google Apps Script: Setting Cell Notes for Guidance Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/change-tracking/FIX-MEDIUM-13-PROGRESS.md Adds helpful notes to the custom start and end date cells (B28 and B29) to guide users. These notes explain the date constraints, such as the start date must be before the end date, and the consequences of invalid entries. ```javascript sheet.getRange('B28').setNote('⚠️ Custom Start Date\n\nMust be BEFORE End Date (B29).\n\nIf invalid, metrics will be incorrect.'); sheet.getRange('B29').setNote('⚠️ Custom End Date\n\nMust be AFTER Start Date (B28).\n\nIf invalid, metrics will be incorrect.'); ``` -------------------------------- ### List Project Files (Bash) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/versions/START-HERE.md Lists essential documentation files using bash commands. Useful for quickly identifying key markdown files for project overview, setup, and changelogs. ```bash ls -lh README.md SETUP.md CHANGELOG.md ``` ```bash ls -lh *REFERENCE*.md *INVENTORY*.md CONTEXT.md ``` ```bash ls -lh *PLAN*.md ``` ```bash ls -lh _archive/change-tracking/ ``` -------------------------------- ### Fix Trial End Date Calculation Formula Source: https://github.com/ochodev/tracking-sheet-project/blob/main/docs/TROUBLESHOOTING.md This Google Sheets formula calculates the trial end date in the 'Lead Data' tab (column R). It checks if the 'Trial Start' date (column Q) is a valid number and adds the trial length specified in 'Settings & Budget'!B33. It ensures calculations only occur for rows with a 'Trial Start' date. ```google-sheets =ARRAYFORMULA(IF(A2:A="","",IF(ISNUMBER(Q2:Q),DATEVALUE(Q2:Q)+'Settings & Budget'!B33,""))) ``` -------------------------------- ### Google Sheets Formula for Lead Data - Action Needed Column Source: https://github.com/ochodev/tracking-sheet-project/blob/main/docs/TESTING-GUIDE.md An ARRAYFORMULA for the 'Action Needed' column (AE2) in the 'Lead Data' tab. This example provides a placeholder text, indicating that specific action logic should be implemented here. ```google-sheets ARRAYFORMULA(IF(ISBLANK(A2:A), "", "Follow up required")) ``` -------------------------------- ### Search Project Files with Grep Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/QUICK-REFERENCE.md Shell commands using 'grep' to efficiently search project documentation and code files. These commands help locate function definitions, understand feature implementations, and identify specific types of functions like validations. ```bash # Find where something is defined grep -n "functionName" FUNCTION-INVENTORY.md ``` ```bash # Find how something works grep -n "keyword" CONTEXT.md ``` ```bash # Find all validation functions grep -n "validate" FUNCTION-INVENTORY.md ``` -------------------------------- ### Formula Update Sequence Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/formulas/FORMULA-ERROR-MAP.md This sequence details the precise order of operations for updating formulas in the tracking sheet, starting with preparation, updating target columns, verifying cascading effects, and final validation. It includes specific formula examples and verification steps. ```plaintext Step 1: PREPARE ├─ Open DASHBOARD tab ├─ Identify current formulas └─ Have new formulas ready Step 2: UPDATE TARGET COLUMN (C10-C16) ├─ Click C10 ├─ Replace: =IFERROR('Settings & Budget'!B2,"⚠️ Setup") ├─ With: =IFERROR('Settings & Budget'!B3,"⚠️ Setup") ├─ Press Enter ├─ Verify: Shows 70 (not "Target") └─ Repeat for C11-C16 (use B4-B9) Step 3: VERIFY CASCADE (No action needed) ├─ Check D10: Should show number ├─ Check E10: Should show number ├─ Check F10: Should show status └─ If any still broken, recheck C10 Step 4: VALIDATE ├─ All Targets show numbers? ✅ ├─ All Goals show numbers? ✅ ├─ All Variances show numbers? ✅ └─ All Statuses show text? ✅ Step 5: DOCUMENT ├─ Add note: "Fixed 2025-10-08" └─ Update changelog ``` -------------------------------- ### COUNTIFS Formula Fix - New Members - DASHBOARD Tab Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/formulas/COLUMN-REFERENCE-FIX-GUIDE.md Fixes a COUNTIFS formula for 'New Members' on the DASHBOARD tab. It adjusts references for 'Member Start' date, 'Converted' checkbox, and 'Cancelled' checkbox columns impacted by the column shift. ```javascript // CURRENT: =COUNTIFS('Lead Data'!S:S,">="&'Settings & Budget'!B30,'Lead Data'!S:S,"<="&'Settings & Budget'!B31,'Lead Data'!R:R,TRUE,'Lead Data'!V:V,FALSE) // FIXED: =COUNTIFS('Lead Data'!T:T,">="&'Settings & Budget'!B30,'Lead Data'!T:T,"<="&'Settings & Budget'!B31,'Lead Data'!S:S,TRUE,'Lead Data'!X:X,FALSE) // CHANGES: // S → T (Member Start date) // R → S (Converted checkbox) // V → X (Cancelled checkbox) ``` -------------------------------- ### Search Project Documentation (Bash) Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/versions/START-HERE.md Searches documentation files for specific keywords using bash's grep command. Aids in locating information related to topics, function names, architecture patterns, and common scenarios within the project's markdown files. ```bash grep -n "topic" COMPLETE-CHANGE-HISTORY.md ``` ```bash grep -n "functionName" FUNCTION-INVENTORY.md ``` ```bash grep -n "pattern" CONTEXT.md ``` ```bash grep -n "scenario" QUICK-REFERENCE.md ``` -------------------------------- ### Verify Net Gain/Loss Formulas - JavaScript Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/formulas/COLUMN-REFERENCE-FIX-GUIDE.md This snippet verifies the Net Gain/Loss formulas in the Metrics tab. It confirms that the column references for 'Member Start' (T), 'Membership Type' (U), and 'Cancel Date' (Y) have been correctly updated to reflect the new column structure. ```javascript // CURRENT (line 2816): 'Lead Data'!T:T,">="&... // Member Start 'Lead Data'!U:U,"${type}" // Membership Type // CHECK: // T is now Member Start (20) ✅ // U is now Membership Type (21) ✅ // CURRENT (line 2819): 'Lead Data'!Y:Y,">="&... // Cancel Date 'Lead Data'!U:U,"${type}" // Membership Type // CHECK: // Y is now Cancel Date (25) ✅ // U is now Membership Type (21) ✅ // ACTUALLY CORRECT! These were updated properly. ``` -------------------------------- ### Test Full Initialization V2 Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/deployment/DEPLOYMENT-GUIDE-V2.md This snippet illustrates how to run the `testInitializeV2()` function in Google Apps Script to test the complete initialization process of the V2 template. This test verifies that the entire template, including all necessary tabs and configurations, is created successfully within approximately 30 seconds. It's a final validation step after deployment. ```javascript testInitializeV2() ``` -------------------------------- ### Automated Quick Test Results Source: https://github.com/ochodev/tracking-sheet-project/blob/main/docs/TESTING-GUIDE.md Presents the expected successful output for the Quick Test, confirming various components like class functionality, tab existence, and configuration settings are working correctly. Warnings are noted but may not be critical. ```text 🧪 QUICK TEST RESULTS ✅ TabBuilder class working ✅ FormulaBuilder working ✅ DASHBOARD exists ✅ Lead Data exists ✅ Members exists ✅ Settings & Budget exists ✅ LTV Analysis exists ✅ _LTV Calculations exists ✅ Caching enabled ✅ Settings configured (Trial: 14 days) ✅ Date range system connected ✅ Marketing Budget section exists ✅ DASHBOARD date range working ✅ Source Analysis exists ✅ LTV Analysis wired ✅ Lead Data dropdowns configured ✅ All tests passed! Ready to use! ``` -------------------------------- ### Update 'Trials Expiring' Formula - JavaScript Source: https://github.com/ochodev/tracking-sheet-project/blob/main/_archive/old-documentation/formulas/COLUMN-REFERENCE-FIX-GUIDE.md This snippet provides the corrected formula for 'Trials Expiring'. It adjusts column references P to R for 'Trial End', Q to S for 'Converted checkbox', and O to Q for 'Trial Start Date' within the FILTER function. ```javascript // CURRENT (BROKEN): =IFERROR(LET(items,FILTER(...,'Lead Data'!P:P>=TODAY(),'Lead Data'!P:P<=TODAY()+3,'Lead Data'!Q:Q=FALSE,'Lead Data'!O:O<>"",...) // FIXED: =IFERROR(LET(items,FILTER(...,'Lead Data'!R:R>=TODAY(),'Lead Data'!R:R<=TODAY()+3,'Lead Data'!S:S=FALSE,'Lead Data'!Q:Q<>"",...) // CHANGES: // P → R (Trial End) // Q → S (Converted checkbox) // O → Q (Trial Start Date) for "has started trial" check ```