Skip to main content

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

  1. Create server container in GTM
  2. Get container URL
  3. Configure on hosting provider
  4. Test container is accessible

Step 3: Configure Custom Domain

  1. Set up subdomain (e.g., tracking.yourdomain.com)
  2. Configure DNS records
  3. Set up SSL certificate
  4. Test domain is accessible

Phase 2: BigQuery Setup

Step 1: Create BigQuery Project

  1. Go to Google Cloud Console
  2. Create new project (or use existing)
  3. Enable BigQuery API
  4. 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

  1. Configure GTM to stream to BigQuery
  2. Set up BigQuery destination in GTM
  3. Test data flow
  4. Verify events are stored

Step 4: Configure Access Controls

  1. Set up service account
  2. Configure permissions
  3. Limit access to authorized users
  4. Document access policies

Phase 3: Website Integration

Step 1: Update GTM Web Container

  1. Add server-side GTM URL
  2. Configure client name
  3. Set up event forwarding
  4. Test events are sent

Step 2: Implement Event Tracking

Key Events to Track:

  • Page views
  • Form submissions
  • Button clicks
  • Purchases
  • Downloads
  • Video plays
  1. Integrate CookieYes (or similar)
  2. Configure consent types
  3. Set up consent mode
  4. Test consent flow

Step 4: Test Event Flow

  1. Trigger test events
  2. Verify events reach server
  3. Check BigQuery for events
  4. Verify platform integrations

Phase 4: Platform Integrations

GA4 Integration

  1. Get GA4 Measurement ID
  2. Configure GA4 destination in GTM
  3. Set up event mapping
  4. Test events in GA4

Meta Conversions API

  1. Get Meta Access Token
  2. Configure Meta destination in GTM
  3. Set up event mapping
  4. Test conversions in Meta

LinkedIn Insight Tag

  1. Get LinkedIn Partner ID
  2. Configure LinkedIn destination in GTM
  3. Set up event mapping
  4. Test conversions in LinkedIn

Phase 5: User ID Setup

Step 1: Generate User ID

  1. Create user ID on first visit
  2. Store in first-party cookie
  3. Include in all events
  4. Maintain across sessions
  1. When user submits form, link email to user ID
  2. Store in BigQuery
  3. Use for attribution
  4. Maintain privacy compliance

Next Step: Learn about BigQuery Integration for detailed setup and querying instructions.