Implementation Guide: Step-by-Step Setup
Follow this guide to implement server-side tracking from start to finish.
Prerequisites Checklist
Before You Start:
- Google Tag Manager account
- Google Cloud account (for BigQuery)
- Server hosting account (Stape, Google Cloud, AWS)
- Access to website code or GTM
- Consent management platform (CookieYes or similar)
- GA4 property set up
- Meta Business Manager access
- LinkedIn Campaign Manager access
Phase 1: Server Setup
Step 1: Choose Hosting Provider
Option 1: Stape (Recommended for Simplicity)
- Easiest setup
- Pre-configured for GTM
- $17-50/month
- Website: stape.io
Option 2: Google Cloud
- More control
- Better for BigQuery integration
- $20-100/month
- More technical setup
Option 3: AWS
- Enterprise-grade
- Most flexible
- $30-150/month
- Most complex setup
Step 2: Set Up Server-Side GTM Container
- Create server container in GTM
- Get container URL
- Configure on hosting provider
- Test container is accessible
Step 3: Configure Custom Domain
- Set up subdomain (e.g.,
tracking.yourdomain.com) - Configure DNS records
- Set up SSL certificate
- Test domain is accessible
Phase 2: BigQuery Setup
Step 1: Create BigQuery Project
- Go to Google Cloud Console
- Create new project (or use existing)
- Enable BigQuery API
- Create dataset for events
Step 2: Configure BigQuery Schema
Event Table Schema:
CREATE TABLE IF NOT EXISTS `your-project.tracking_data.events` (
event_name STRING NOT NULL,
event_timestamp TIMESTAMP NOT NULL,
user_id STRING,
session_id STRING,
page_url STRING,
page_title STRING,
referrer STRING,
utm_source STRING,
utm_medium STRING,
utm_campaign STRING,
utm_term STRING,
utm_content STRING,
device_type STRING,
browser STRING,
os STRING,
country STRING,
city STRING,
event_data JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP()
)
PARTITION BY DATE(event_timestamp)
CLUSTER BY event_name, user_id;
Step 3: Set Up Data Streaming
- Configure GTM to stream to BigQuery
- Set up BigQuery destination in GTM
- Test data flow
- Verify events are stored
Step 4: Configure Access Controls
- Set up service account
- Configure permissions
- Limit access to authorized users
- Document access policies
Phase 3: Website Integration
Step 1: Update GTM Web Container
- Add server-side GTM URL
- Configure client name
- Set up event forwarding
- Test events are sent
Step 2: Implement Event Tracking
Key Events to Track:
- Page views
- Form submissions
- Button clicks
- Purchases
- Downloads
- Video plays
Step 3: Set Up Consent Management
- Integrate CookieYes (or similar)
- Configure consent types
- Set up consent mode
- Test consent flow
Step 4: Test Event Flow
- Trigger test events
- Verify events reach server
- Check BigQuery for events
- Verify platform integrations
Phase 4: Platform Integrations
GA4 Integration
- Get GA4 Measurement ID
- Configure GA4 destination in GTM
- Set up event mapping
- Test events in GA4
Meta Conversions API
- Get Meta Access Token
- Configure Meta destination in GTM
- Set up event mapping
- Test conversions in Meta
LinkedIn Insight Tag
- Get LinkedIn Partner ID
- Configure LinkedIn destination in GTM
- Set up event mapping
- Test conversions in LinkedIn
Phase 5: User ID Setup
Step 1: Generate User ID
- Create user ID on first visit
- Store in first-party cookie
- Include in all events
- Maintain across sessions
Step 2: Link User ID to Conversions
- When user submits form, link email to user ID
- Store in BigQuery
- Use for attribution
- Maintain privacy compliance
Next Step: Learn about BigQuery Integration for detailed setup and querying instructions.