GoSquared Troubleshooting & Debugging | OpsBlu Docs

GoSquared Troubleshooting & Debugging

Diagnose and resolve common GoSquared analytics issues including missing data, broken live chat, real-time dashboard errors, and user identification.

Diagnostic Approach

GoSquared issues typically fall into three categories: tracking code failures (no data), identity resolution problems (fragmented users), and live chat / real-time dashboard glitches. Start by checking if the _gs function loads, then work outward.

Tracking Code Not Loading

Symptoms: No data in dashboard, zero visitors, _gs is not defined in console.

Step 1: Verify the snippet is present.

Open your site, right-click → View Page Source, and search for gosquared.js. If it's missing, the tracking code wasn't installed or is being stripped by your build process.

Step 2: Check for JavaScript errors blocking execution.

// Open browser console (F12 → Console) and run:
console.log(typeof _gs);
// Expected: 'function'
// If 'undefined': snippet didn't load or errored

// Check for errors:
// Look for red errors in the console — any uncaught exception
// that runs before the GoSquared snippet can prevent it from loading

Step 3: Check for ad blockers and privacy extensions.

GoSquared's CDN (d1l6p2sc9645hc.cloudfront.net) is on some ad blocker lists. Test in incognito mode with extensions disabled. If it works in incognito but not normally, the issue is client-side blocking.

Step 4: Verify the project token.

// In the console, after _gs loads:
_gs('debug', true);
// This enables verbose logging — check that the token matches
// your GoSquared dashboard → Settings → Tracking Code

Common fixes:

  • Snippet placed after </body> instead of before it — move it inside <body>.
  • Async race condition in SPA frameworks — ensure the snippet loads before your first _gs('track') call.
  • CSP (Content Security Policy) blocking the CDN — add d1l6p2sc9645hc.cloudfront.net to your script-src directive.

Events Not Recording

Symptoms: Page views appear but custom events show zero in reports.

// Enable debug mode to see events in console
_gs('debug', true);

// Fire a test event
_gs('event', 'Test Event', { source: 'debug' });
// Console should show the outbound request

// Common mistake: using 'record' instead of 'event'
// Correct GoSquared API:
_gs('event', 'Event Name', { property: 'value' });

Checklist:

  • Event names are case-sensitive — Signed Up and signed up are different events.
  • Properties must be flat key-value objects (no nested objects or arrays).
  • Events fired before _gs loads are silently dropped — ensure the snippet is loaded first or use the queue pattern: window._gs = window._gs || function(){ (_gs.q = _gs.q || []).push(arguments) }.

User Identification Problems

Symptoms: Same person appears as multiple visitors, or identified users show as anonymous.

// Identify users after login
_gs('identify', {
  id: 'user-12345',          // Required: unique user ID
  email: 'user@example.com', // Optional but recommended
  name: 'Jane Smith',        // Optional
  custom: {
    plan: 'Enterprise',
    company: 'Acme Corp'
  }
});

Common issues:

  • Calling _gs('identify') before the snippet loads — use the queue pattern above.
  • Inconsistent IDs across sessions — always use the same user ID format (database ID, not email, unless email is your canonical ID).
  • Identify called on every page load with partial data — call once after authentication, GoSquared persists the identity in cookies.

Live Chat Not Showing

Symptoms: Chat widget doesn't appear on the page, or appears intermittently.

  1. Check if chat is enabled: GoSquared Dashboard → Engage → Settings → verify chat is toggled on.
  2. Check page targeting rules: If you've set the widget to show only on specific pages, verify the URL patterns match.
  3. Inspect CSS conflicts: The chat widget uses a fixed-position container. Check if your site's CSS has z-index or overflow: hidden rules on body or parent containers that hide it.
  4. Check for duplicate snippets: If the GoSquared snippet loads twice (e.g., via GTM and direct embed), the chat widget can fail to initialize.
// Force-check chat availability
_gs('chat', 'show');
// If this doesn't surface the widget, the issue is CSS or configuration

Real-Time Dashboard Issues

Visitors not appearing in real-time view:

  • GoSquared's real-time dashboard updates via WebSocket. If your network blocks WebSocket connections (corporate firewalls, VPNs), the dashboard appears frozen.
  • Check browser console on the GoSquared dashboard itself for WebSocket errors.
  • Try a different browser or network to isolate.

Data delay exceeding 5 minutes:

  • GoSquared processes most events within seconds. Delays beyond 5 minutes usually indicate a platform-side processing queue. Check GoSquared Status for incidents.
  • If only specific events are delayed, verify the events are actually firing (use debug mode on your site).

SPA Tracking Issues

Single-page applications need manual page tracking on route changes:

// React (with React Router)
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function useGoSquaredTracking() {
  const location = useLocation();
  useEffect(() => {
    if (typeof _gs === 'function') {
      _gs('track', location.pathname, document.title);
    }
  }, [location]);
}

// Vue Router
router.afterEach((to) => {
  if (typeof _gs === 'function') {
    _gs('track', to.path, to.meta.title || document.title);
  }
});

// Next.js (App Router)
// In your root layout.tsx, use the usePathname hook:
'use client';
import { usePathname } from 'next/navigation';
import { useEffect } from 'react';

export function GoSquaredTracker() {
  const pathname = usePathname();
  useEffect(() => {
    if (typeof _gs === 'function') _gs('track');
  }, [pathname]);
  return null;
}

Common SPA mistake: Not passing the new page path to _gs('track') — GoSquared may record all SPA navigations under the initial page URL.

GDPR / Privacy Configuration

// Enable IP anonymization for GDPR compliance
_gs('set', 'anonymizeIP', true);

// Disable tracking until consent is given
// Don't load the snippet until consent is obtained, or:
_gs('set', 'trackLocal', false);   // Don't track localhost
_gs('set', 'trackParams', false);  // Don't capture URL parameters

For cookie consent integration, conditionally load the GoSquared snippet only after the user accepts analytics cookies in your CMP (OneTrust, Cookiebot, etc.).

GoSquared Support Resources