Skip to content

Latest commit

 

History

History
173 lines (133 loc) · 5.57 KB

File metadata and controls

173 lines (133 loc) · 5.57 KB

HubSpot Integration Deployment Checklist

Why HubSpot Instead of Google Ads?

  • No business verification required (Google Ads needs weeks of approval)
  • Free account creation in 2 minutes
  • Instant API access through simple OAuth2
  • Rich CRM data that complements your GA4 analytics
  • No developer tokens or special permissions needed

Files to Add/Update

New Files to Add:

  • HubSpot.gs - Complete HubSpot API integration

Files to Update:

  • DataSource.gs - Updated with HubSpot integration calls
  • Reports.gs - Updated with HubSpot report templates
  • DataSourceManager.html - Updated to show HubSpot as available
  • Testing.gs - Added HubSpot testing functions

Files That Remain Unchanged:

  • Main.gs - Already supports multi-data sources
  • Sidebar.html - Already supports data source switching
  • ReportBuilder.html - Already supports multiple sources
  • Backend.gs - Already supports multi-source usage tracking
  • All GA4 files (Analytics.gs, Auth.gs, etc.) - No changes needed

Setup Process (Total: ~10 minutes)

Step 1: Create HubSpot Account (2 minutes)

  1. Go to hubspot.com
  2. Sign up for free account
  3. Complete basic onboarding

Step 2: Create HubSpot App (5 minutes)

  1. Go to developers.hubspot.com
  2. Create new app
  3. Configure OAuth with redirect URI:
    https://script.google.com/macros/d/YOUR_SCRIPT_ID/usercallback
    
  4. Add required scopes: contacts, content, crm.objects.companies.read, crm.objects.deals.read
  5. Get Client ID and Client Secret

Step 3: Configure Apps Script (2 minutes)

  1. Add to Script Properties:
    HUBSPOT_CLIENT_ID = your_client_id
    HUBSPOT_CLIENT_SECRET = your_client_secret
    

Step 4: Deploy and Test (1 minute)

  1. Deploy the new files
  2. Run quickTestHubSpot() to verify setup

Testing Checklist

Run these functions in Apps Script:

Basic Framework Test

function testBasicSetup() {
  // Should show HubSpot as available
  var config = getDataSourceConfig();
  Logger.log('HubSpot config: ' + JSON.stringify(config.hubspot));
  
  // Should load HubSpot metadata
  var metadata = getDataSourceMetadata('hubspot');
  Logger.log('HubSpot fields: ' + metadata.dimensions.length + '/' + metadata.metrics.length);
}

Authentication Test

function testHubSpotAuth() {
  // Before auth - should be false
  Logger.log('Auth before: ' + isHubSpotAuthenticated());
  
  // Get auth URL - should return URL
  var authResult = initiateHubSpotAuth({scopes: ['contacts', 'content']});
  Logger.log('Auth URL: ' + authResult.authUrl);
}

Full Integration Test

function testCompleteFlow() {
  runAllTests(); // Runs all tests including HubSpot
}

What Users Will Experience

1. Data Source Selection

  • Users see HubSpot as an available option
  • Can switch between GA4 and HubSpot seamlessly
  • Authentication status shows per data source

2. HubSpot Authentication

  • Click "Connect to HubSpot"
  • OAuth popup opens
  • User logs into HubSpot and grants permissions
  • Returns to app, now connected

3. HubSpot Reports

  • Select dimensions like "First Name", "Last Name", "Email"
  • Select metrics like "Contact Notes", "Website Visits"
  • Preview and import data to sheets
  • Same familiar interface as GA4

4. Available Data

Contact Reports:

  • Basic info: Name, email, phone, company, job title
  • Activity: Contact notes, website visits, email engagement
  • Lifecycle: Create date, lifecycle stage, lead status

Company Reports:

  • Company details: Name, domain, industry, location
  • Business metrics: Employee count, annual revenue

Sales Reports:

  • Deal information: Name, amount, stage, pipeline
  • Sales metrics: Deal values, conversion events

Rollback Plan

If issues occur:

  1. Disable HubSpot in UI: Update DataSourceManager.html to mark HubSpot as "coming-soon"
  2. Remove Authentication: Delete HubSpot script properties
  3. Revert Code: Remove HubSpot.gs and revert DataSource.gs changes

All GA4 functionality remains unchanged, so users can continue using existing features.

Success Metrics

Track these after deployment:

  • HubSpot authentication success rate
  • Number of HubSpot reports created vs GA4
  • User adoption rate of HubSpot data source
  • Error rates and common support issues
  • Usage distribution: Contacts vs Companies vs Deals data

User Communication

Announcement Message:

"New: Import your HubSpot CRM data! Connect your HubSpot account to import contacts, companies, and deals data directly into Google Sheets. Perfect for sales reporting and customer analysis alongside your GA4 analytics."

Help Documentation Updates:

  • Add "How to Connect HubSpot" guide
  • Document available HubSpot fields and metrics
  • Provide sample report templates
  • Include troubleshooting for common HubSpot issues

Future Expansion Roadmap

With HubSpot working, the framework is proven for additional sources:

Next Priority Sources:

  1. Spotify - Creator/artist analytics (simple OAuth)
  2. Facebook Ads - Marketing analytics (needs business verification but simpler than Google Ads)
  3. Google Ads - When users need it and have approval
  4. Custom APIs - Any REST API with OAuth2

Framework Benefits:

  • Each new source takes ~1-2 days instead of weeks
  • Consistent user experience across all sources
  • Shared authentication, usage tracking, and UI patterns
  • Easy to maintain and extend

The HubSpot integration proves your multi-data source architecture works and provides immediate value to users who want CRM data alongside their analytics.