Implementation Overview
GoSquared provides real-time web analytics, customer data platform, and live chat capabilities. This comprehensive guide will help you implement GoSquared across your digital properties for visitor tracking, user engagement, and behavioral analytics.
Prerequisites
Before implementing GoSquared, ensure you have:
- GoSquared Account: Active account with project created
- Project Token: Your unique tracking identifier (format:
GSN-XXXXXX-X) - Website Access: Ability to modify HTML or deploy via tag manager
- Development Environment: For testing implementation before production
Quick Start
1. Create Account
- Sign up at gosquared.com
- Complete email verification
- Create your first project
- Note your project token from Settings → Tracking
2. Add Tracking Code
Add the tracking snippet before the closing </body> tag:
<script>
!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(arguments)};
d=s.createElement(q);d.src='//d1l6p2sc9645hc.cloudfront.net/gosquared.js';
q=s.getElementsByTagName(q)[0];q.parentNode.insertBefore(d,q)}
(window,document,'script','_gs');
_gs('GSN-XXXXXX-X'); // Replace with your project token
</script>
3. Verify Installation
- Visit your website with the tracking code installed
- Open GoSquared dashboard → Now tab
- Verify your visit appears in real-time
- Check browser console for errors
Implementation Methods
Standard JavaScript Tag
Best for most websites:
<script>
!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(arguments)};
d=s.createElement(q);d.src='//d1l6p2sc9645hc.cloudfront.net/gosquared.js';
q=s.getElementsByTagName(q)[0];q.parentNode.insertBefore(d,q)}
(window,document,'script','_gs');
_gs('GSN-123456-A');
_gs('set', 'anonymizeIP', true); // Optional: GDPR compliance
</script>
Google Tag Manager
- Create new Custom HTML tag
- Paste GoSquared tracking code
- Set trigger to "All Pages"
- Publish container
NPM Package
For modern JavaScript frameworks:
npm install gosquared
import GoSquared from 'gosquared';
GoSquared.load('GSN-123456-A');
GoSquared.trackEvent('Page View');
Configuration Options
Basic Configuration
_gs('GSN-123456-A');
_gs('set', 'anonymizeIP', true);
_gs('set', 'cookieDomain', '.example.com');
_gs('set', 'useCookies', true);
Available Settings
| Setting | Type | Description | Default |
|---|---|---|---|
anonymizeIP |
boolean | Anonymize visitor IP addresses | false |
cookieDomain |
string | Cookie domain scope | Current domain |
useCookies |
boolean | Enable cookie tracking | true |
trackLocal |
boolean | Track localhost traffic | false |
trackHash |
boolean | Track hash changes as pageviews | false |
Testing Your Implementation
Browser Console Verification
Check that the global _gs object exists:
console.log(typeof _gs); // Should output "function"
console.log(_gs.q); // Should show queued commands
Network Tab Verification
- Open browser DevTools → Network tab
- Filter for "gosquared"
- Verify requests to
d1l6p2sc9645hc.cloudfront.net - Check 200 response status
Real-Time Dashboard
Monitor the Now tab in GoSquared dashboard for live visitor data.
Common Implementation Issues
| Issue | Cause | Solution |
|---|---|---|
| No data appearing | Incorrect token | Verify project token in Settings |
| Duplicate tracking | Multiple installations | Remove duplicate tracking codes |
| CORS errors | Mixed content | Ensure HTTPS on all pages |
| Ad blocker interference | Privacy extensions | Test in incognito mode |
| Slow page load | Blocking script | Use async loading method |
Next Steps
After basic installation, configure advanced features:
- Install Tracking Code - Detailed installation methods
- Event Tracking Setup - Track custom user actions
- Data Layer Setup - Enrich visitor profiles
- Cross-Domain Tracking - Track users across domains
- Server-Side vs Client-Side - Choose tracking approach
Best Practices
- Test in Development: Verify tracking before production deployment
- Use Environment Variables: Store project tokens securely
- Monitor Performance: Check page load impact with tracking
- Document Custom Events: Maintain event naming conventions
- Regular Audits: Verify tracking continues to work after site updates