diff options
-rw-r--r-- | static/bs/bracket.js | 157 | ||||
-rw-r--r-- | static/bs/index.html | 2 |
2 files changed, 2 insertions, 157 deletions
diff --git a/static/bs/bracket.js b/static/bs/bracket.js index b40583e..8e346f1 100644 --- a/static/bs/bracket.js +++ b/static/bs/bracket.js @@ -452,29 +452,9 @@ class BracketCityRank { } catch (error) { console.error('Failed to initialize game:', error); this.showErrorMessage('Failed to load the game. Please refresh the page to try again.'); - - gtag('event', 'error', { - 'error_type': 'initialization_error', - 'error_message': error.message - }); } } - initializeAnalytics() { - - // Only fire once. - if (this.gaStartFired) return; - this.gaStartFired = true; - - // Track puzzle start - gtag('event', 'puzzle_start', { - 'puzzle_date': this.currentPuzzleDate, - 'user_id': this.userId, - 'device_type': this.isMobile ? 'mobile' : 'desktop' - }); - console.log('Fired puzzle_start event'); - } - /** * Initializes or retrieves the user ID * @returns {string} User ID @@ -827,10 +807,6 @@ class BracketCityRank { } catch (error) { console.error('Error loading saved state:', error); - gtag('event', 'error', { - 'error_type': 'load_state_error', - 'error_message': error.message - }); return null; } } @@ -864,10 +840,6 @@ class BracketCityRank { } catch (error) { console.error('Error saving state:', error); - gtag('event', 'error', { - 'error_type': 'save_state_error', - 'error_message': error.message - }); return false; } } @@ -881,12 +853,6 @@ class BracketCityRank { return; } - // Track reset event if needed. - gtag('event', 'puzzle_reset', { - 'puzzle_date': this.currentPuzzleDate, - 'progress': this.state.solvedExpressions.size - }); - // Clear saved state. const storageKey = this.getStorageKey(); if (storageKey) { @@ -1048,10 +1014,6 @@ class BracketCityRank { } catch (error) { console.error('Error fetching puzzle:', error); - gtag('event', 'error', { - 'error_type': 'puzzle_fetch_error', - 'error_message': error.message - }); return false; } } @@ -1371,12 +1333,6 @@ class BracketCityRank { }); this.showMessage('Incorrect!', 'error'); - - gtag('event', 'wrong_guess', { - 'puzzle_date': this.currentPuzzleDate, - 'input': input, - 'wrong_guesses': this.state.wrongGuesses - }); } // Clear input @@ -1462,14 +1418,6 @@ class BracketCityRank { } } - if (isFirstSolve) { - gtag('event', 'solved_one_clue', { - 'puzzle_date': this.currentPuzzleDate, - 'user_id': this.userId, - 'device_type': this.isMobile ? 'mobile' : 'desktop' - }); - } - // Re-render the puzzle display requestAnimationFrame(() => { this.render(); @@ -1545,12 +1493,6 @@ class BracketCityRank { peekedClues: new Set([...this.state.peekedClues, expression]) }); - gtag('event', 'peek_used', { - 'puzzle_date': this.currentPuzzleDate, - 'user_id': this.userId, - 'device_type': this.isMobile ? 'mobile' : 'desktop' - }); - this.render(); } @@ -1583,12 +1525,6 @@ class BracketCityRank { hintModeClues: new Set([...this.state.hintModeClues].filter(e => e !== expression)) }); - gtag('event', 'mega_peek_used', { - 'puzzle_date': this.currentPuzzleDate, - 'user_id': this.userId, - 'device_type': this.isMobile ? 'mobile' : 'desktop' - }); - this.render(); } @@ -1935,12 +1871,6 @@ class BracketCityRank { // Add both mouse and touch event listeners to handle closing document.addEventListener('click', closeCalendar); document.addEventListener('touchend', closeCalendar); - - // Track calendar open event - gtag('event', 'calendar_opened', { - 'current_puzzle_date': this.currentPuzzleDate, - 'device_type': isMobile ? 'mobile' : 'desktop' - }); } else { datePickerContainer.style.display = 'none'; } @@ -2267,14 +2197,6 @@ class BracketCityRank { // Navigate to selected puzzle container.style.display = 'none'; - // Track date selection event - gtag('event', 'calendar_date_selected', { - 'selected_date': targetDate, - 'from_date': this.currentPuzzleDate, - 'puzzle_status': cell.dataset.status, - 'device_type': /Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ? 'mobile' : 'desktop' - }); - await this.navigateToPuzzle(targetDate); }; @@ -2584,22 +2506,9 @@ class BracketCityRank { this.render(); this.setupDatePicker(); - - // Track navigation event - gtag('event', 'puzzle_navigation', { - 'from_date': previousDate, - 'to_date': targetDate, - 'direction': targetDate > previousDate ? 'next' : 'previous' - }); - } catch (error) { console.error('Navigation failed:', error); this.showErrorMessage('Failed to load puzzle. Please try again.'); - gtag('event', 'error', { - 'error_type': 'navigation_error', - 'error_message': error.message, - 'target_date': targetDate - }); } finally { this.setNavigationLoading(false); } @@ -3185,12 +3094,7 @@ generateSpecialKeyHTML(keyItem) { <a href="${this.PUZZLE_DATA.completionURL}" target="_blank" rel="noopener noreferrer" - class="completion-url" - onclick="gtag('event', 'click', { - 'event_category': 'puzzle', - 'event_label': 'completion_url', - 'value': 1 - });"> + class="completion-url"> ${this.PUZZLE_DATA.completionURL} </a> </div> @@ -3344,9 +3248,6 @@ generateSpecialKeyHTML(keyItem) { * Sets up puzzle display and help system */ setupPuzzleDisplay() { - - // puzzle start event - this.initializeAnalytics(); const puzzleDisplay = this.root.querySelector('.puzzle-display'); if (!puzzleDisplay) { @@ -3516,14 +3417,6 @@ generateSpecialKeyHTML(keyItem) { infoButton.addEventListener('click', (e) => { e.stopPropagation(); - gtag('event', 'info_viewed', { - 'info_version': this.INFO_VERSION, - 'user_id': this.userId, - 'puzzle_date': this.currentPuzzleDate, - 'first_view': !this.hasSeenInfo(), - 'input_mode': this.inputMode - }); - // Mark as seen when clicked if (!this.hasSeenInfo()) { this.markInfoAsSeen(); @@ -3567,11 +3460,6 @@ generateSpecialKeyHTML(keyItem) { // ON (checked) = classic mode, OFF (unchecked) = submit mode const newMode = modeToggle.checked ? 'classic' : 'submit'; this.setInputMode(newMode); - - gtag('event', 'input_mode_changed', { - 'mode': newMode, - 'user_id': this.userId - }); }); } @@ -3634,13 +3522,6 @@ generateSpecialKeyHTML(keyItem) { if (confirm('Would you like to start the tutorial?')) { localStorage.setItem('tutorialSeen', 'true'); this.saveState(); - // Track tutorial activation - gtag('event', 'tutorial_start', { - 'puzzle_date': this.currentPuzzleDate, - 'user_id': this.userId, - 'device_type': this.isMobile ? 'mobile' : 'desktop', - 'new_player': this.isNewPlayer() - }); window.location.href = '/tutorial'; } }); @@ -3906,13 +3787,6 @@ generateSpecialKeyHTML(keyItem) { wrong_guess_count: this.state.wrongGuesses || 0, input_mode: this.inputMode }; - - console.log('Firing GA event with payload:', payload); - try { - window.gtag('event', 'puzzle_complete', payload); - } catch (e) { - console.error('Error firing GA event:', e); - } } @@ -4084,11 +3958,6 @@ generateSpecialKeyHTML(keyItem) { } }); - // Track successful signup - gtag('event', 'email_signup_success', { - 'puzzle_date': this.this.currentPuzzleDate - }); - } catch (error) { this.updateGameState({ emailSignup: { @@ -4247,11 +4116,6 @@ generateSpecialKeyHTML(keyItem) { * Falls back to SMS URL scheme if Web Share API is not available */ shareSMS() { - // Track share attempt - gtag('event', 'share_sms', { - 'puzzle_date': this.currentPuzzleDate - }); - const shareText = this.generateShareText(); // Check if Web Share API is available @@ -4289,11 +4153,6 @@ generateSpecialKeyHTML(keyItem) { * Copies results to clipboard for desktop sharing */ shareResults() { - // Track copy attempt - gtag('event', 'share_copy', { - 'puzzle_date': this.currentPuzzleDate - }); - const shareText = this.generateShareText(); // Use navigator.clipboard API for modern browsers @@ -4458,13 +4317,6 @@ fallbackCopyToClipboard(text) { overlay.classList.add('visible'); }, 100); - // Track announcement view in analytics if available - if (window.gtag) { - gtag('event', 'view_announcement', { - 'modal_id': modalId - }); - } - return true; } @@ -4497,13 +4349,6 @@ fallbackCopyToClipboard(text) { if (modalId) { this.markAnnouncementAsSeen(modalId); } - - // Track dismissal in analytics if available - if (window.gtag) { - gtag('event', 'dismiss_announcement', { - 'modal_id': modalId - }); - } } /** diff --git a/static/bs/index.html b/static/bs/index.html index a224368..c9d49ce 100644 --- a/static/bs/index.html +++ b/static/bs/index.html @@ -11,7 +11,7 @@ <!-- Open Graph meta tags --> <meta property="og:title" content="Bracket Shitty" /> - <meta property="og:description" content="come visit bracket city" /> + <meta property="og:description" content="come visit bracket shitty" /> <meta property="og:image" content="https://bracket.city/bc-postcard.jpg" /> <meta property="og:url" content="https://bracket.city/" /> <meta property="og:type" content="website" /> |