Server-Side Tracking Guide

Meta Conversions API & GA4 Measurement Protocol

Premium Feature | Plugin Version: 1.2+

What is Server-Side Tracking?

Server-side tracking sends events directly from your WordPress server to Meta (Facebook) and Google Analytics 4, bypassing the browser entirely.

Why Use Server-Side Tracking?

Traditional (Client-Side) Tracking:

  • ❌ Blocked by ad blockers (20-30% of users)
  • ❌ Affected by iOS 14+ App Tracking Transparency
  • ❌ Requires user’s browser to load scripts
  • ❌ Lost if user closes tab before event fires
  • ❌ Limited by privacy features

Server-Side Tracking:

  • ✅ Cannot be blocked by browser extensions
  • ✅ Not affected by iOS privacy features
  • ✅ Guaranteed delivery from your server
  • ✅ Captures 30-40% more events
  • ✅ Works even if user closes tab immediately
  • ✅ Still GDPR compliant (respects consent)

What’s Included

Advanced DataLayer Tracker includes two server-side tracking systems:

1. Meta Conversions API (CAPI)

Send events to Facebook/Meta from your server for:

  • Purchase events
  • Add to cart events
  • Form submissions
  • Page views
  • Custom conversions

Compatible with: Meta Ads, Facebook Pixel

2. GA4 Measurement Protocol

Send events to Google Analytics 4 from your server for:

  • E-commerce events
  • Form submissions
  • Page views
  • Custom events
  • All GA4 standard events

Compatible with: Google Analytics 4, Google Ads

Prerequisites

Before setting up server-side tracking:

  • ADT Premium License – Server-side tracking is a premium feature
  • Meta Pixel ID (for Meta CAPI)
  • GA4 Measurement ID (for GA4 MP)
  • WooCommerce (optional, for e-commerce tracking)
  • Working client-side tracking – Set up standard tracking first

Part 1: Meta Conversions API Setup

Step 1: Get Your Meta Access Token

  1. Go to Meta Events Manager
  2. Select your Data Source (your pixel)
  3. Click Settings tab
  4. Scroll to Conversions API
  5. Click Generate Access Token
  6. Copy the token (starts with EAA...)

Security Note: Keep this token secret – it gives server access to your Meta account.

Step 2: Configure in WordPress

  1. Go to WordPress AdminADT Settings
  2. Click the Pixel Tracking tab
  3. Scroll to Meta Conversions API (Server-Side) section
  4. Check Enable Meta Conversions API
  5. Paste your Meta Access Token
  6. (Optional) Add Test Event Code for testing

Step 3: Test Your Setup

  1. In Meta Events Manager, go to Test Events
  2. Copy your Test Event Code
  3. Paste it in ADT Settings (Meta CAPI section)
  4. Save Settings
  5. Visit your site and trigger an event (add to cart, purchase, etc.)
  6. Check Meta Events Manager → Test Events – you should see the event appear!

Step 4: Go Live

  1. Remove the Test Event Code from ADT Settings
  2. Save Settings
  3. Events now send to production

What Gets Sent:

  • Event name (e.g., Purchase, AddToCart)
  • Event time
  • User data (hashed email, IP address – GDPR compliant)
  • Event parameters (product ID, value, currency)
  • Event source (set to website)

Part 2: GA4 Measurement Protocol Setup

Step 1: Get Your Measurement ID

  1. Go to Google Analytics
  2. Click Admin (bottom left)
  3. Under Property, click Data Streams
  4. Click your Web Stream
  5. Copy the Measurement ID (format: G-XXXXXXXXXX)

Step 2: Generate API Secret

While still in your Data Stream:

  1. Scroll down to Measurement Protocol API secrets
  2. Click Create
  3. Give it a name (e.g., “ADT Server-Side”)
  4. Click Create
  5. Copy the Secret Value

Step 3: Configure in WordPress

  1. Go to WordPress AdminADT Settings
  2. Click the Pixel Tracking tab
  3. Scroll to GA4 Measurement Protocol (Server-Side) section
  4. Check Enable GA4 Measurement Protocol
  5. Enter your GA4 Measurement ID (G-XXXXXXXXXX)
  6. Enter your GA4 API Secret
  7. Save Settings

Step 4: Test Your Setup

Option A: Use Debug Mode

  1. Check GA4 Debug Mode in ADT Settings
  2. Save Settings
  3. Trigger an event on your site
  4. Go to GA4 → ConfigureDebugView
  5. You should see your event appear!

Option B: Check Real-Time Reports

  1. Go to GA4 → ReportsRealtime
  2. Trigger an event on your site
  3. Within 10 seconds, it should appear in real-time reports

Step 5: Go Live

  1. Uncheck GA4 Debug Mode
  2. Save Settings
  3. Events now send to production GA4

Advanced Configuration

Dual Tracking Mode

What is Dual Tracking? Send events BOTH client-side (GTM) AND server-side simultaneously.

Why use it?

  • Maximum reliability – if one fails, the other succeeds
  • Best of both worlds – GTM flexibility + server-side reliability
  • Automatic deduplication – no double-counting
  • Useful during migration from client-only to server-side

How to Enable:

  1. Go to ADT SettingsPixel Tracking tab
  2. Scroll to GA4 Measurement Protocol section
  3. Check Enable Dual Tracking (Client + Server)
  4. Save Settings

How Deduplication Works:

  • Each event gets a unique event_id
  • Both client and server send the same event_id
  • GA4/Meta automatically deduplicate based on event_id
  • Only counts once in reports

Which Events Are Sent Server-Side?

Meta Conversions API

E-commerce Events:

  • Purchase – Transaction completed
  • AddToCart – Item added to cart
  • InitiateCheckout – Checkout started
  • ViewContent – Product page viewed

Form Events:

  • Lead – Form submitted
  • CompleteRegistration – User registered

Standard Events:

  • PageView – Page loaded

GA4 Measurement Protocol

E-commerce Events:

  • purchase – Transaction completed
  • add_to_cart – Item added to cart
  • view_item – Product viewed
  • begin_checkout – Checkout started
  • add_payment_info – Payment step
  • add_shipping_info – Shipping step

Form Events:

  • form_submit – Form completed
  • sign_up – User registered
  • login – User logged in

Standard Events:

  • page_view – Page loaded
  • search – Search performed

Verification Checklist

Meta CAPI Verification

  • [ ] Meta pixel is working client-side first
  • [ ] Access token is valid and pasted correctly
  • [ ] Test events appear in Meta Events Manager
  • [ ] Event Matching Quality score shows in Events Manager
  • [ ] Production events appear in Events Manager (after removing test code)

GA4 MP Verification

  • [ ] GA4 tracking is working client-side first
  • [ ] Measurement ID format is correct (G-XXXXXXXXXX)
  • [ ] API Secret is correct
  • [ ] Events appear in DebugView (with debug mode on)
  • [ ] Events appear in Realtime reports
  • [ ] Events appear in standard reports (wait 24-48 hours)

Troubleshooting

Meta CAPI Issues

Problem: Events not appearing in Meta Events Manager

Solutions:

  1. Verify access token is correct (starts with EAA...)
  2. Check Meta pixel ID matches your pixel
  3. Ensure premium license is active
  4. Check WordPress debug log for errors
  5. Verify consent is granted (CAPI respects GDPR)

Problem: Low Event Match Quality

Solutions:

  1. Enable email collection on forms
  2. Use Meta’s Advanced Matching features
  3. Include phone numbers in form data
  4. Collect ZIP codes for geographic matching

GA4 MP Issues

Problem: Events not appearing in GA4

Solutions:

  1. Verify Measurement ID is correct (format: G-XXXXXXXXXX)
  2. Verify API Secret is correct
  3. Check DebugView with debug mode enabled
  4. Wait 24-48 hours for standard reports (real-time should be instant)
  5. Ensure client_id is being generated properly

Problem: Events are duplicated

Solutions:

  1. Ensure event_id is being sent
  2. Check if dual tracking is properly configured
  3. Verify only one instance of ADT is active
  4. Check if GTM container has conflicting tags

General Issues

Problem: Server-side tracking not working at all

Solutions:

  1. ✅ Verify premium license is active
  2. ✅ Check that server-side tracking is enabled in settings
  3. ✅ Ensure PHP version is 7.4+ (required for server-side)
  4. ✅ Check WordPress debug log for PHP errors
  5. ✅ Verify AJAX endpoints are not blocked by security plugins

How to check debug log:

  1. Enable WordPress debug mode (add to wp-config.php):
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
  1. Check /wp-content/debug.log for ADT errors

Privacy & Compliance

GDPR Compliance

Server-side tracking in ADT is GDPR compliant:

Respects Consent:

  • Events only fire if user has granted consent
  • Blocked events are NOT sent server-side
  • Consent status is checked before transmission

Data Hashing:

  • Email addresses are SHA-256 hashed
  • IP addresses are sent but can be disabled
  • No raw PII is transmitted

User Control:

  • Users can revoke consent anytime
  • Consent revocation stops both client and server tracking
  • Data deletion requests can be handled via Meta/Google

What Data is Sent?

User Data (Hashed):

  • Email address (SHA-256 hash)
  • IP address (optional, for matching)
  • User agent string
  • Browser language
  • Client ID (anonymous)

Event Data:

  • Event name
  • Event time
  • Event parameters (product IDs, values, etc.)
  • Page URL
  • Referrer URL

NOT Sent:

  • Plain text emails
  • Passwords
  • Payment information
  • Full credit card numbers
  • Social security numbers
  • Any PII not explicitly configured

Performance Impact

Server-side tracking has minimal performance impact:

Page Load Time: No impact (events sent after page loads) Server Load: Negligible (~0.1% CPU usage) Bandwidth: ~2KB per event Database: No additional database queries

Recommended Limits:

  • Up to 10,000 events/hour supported
  • Batch processing available for high volume
  • Automatic rate limiting prevents API overload

Best Practices

1. Start with Client-Side First

Always set up and verify client-side tracking before enabling server-side:

  1. ✅ GTM container working
  2. ✅ GA4 tracking verified
  3. ✅ Meta pixel firing
  4. ✅ Events appearing in reports
  5. → THEN enable server-side

2. Use Dual Tracking Initially

When first enabling server-side:

  1. Enable dual tracking mode
  2. Monitor both client and server events
  3. Verify deduplication is working
  4. After 7 days, decide if you want server-only or keep dual

3. Monitor Event Match Quality

For Meta CAPI:

  1. Check Events Manager weekly
  2. Aim for Event Match Quality > 6.0
  3. Improve by collecting more user data (email, phone, ZIP)
  4. Use Meta’s match rate report

4. Test Before Production

Always use test modes before going live:

  • Meta: Use Test Event Code
  • GA4: Use Debug Mode
  • Verify events appear correctly
  • Remove test modes before production

5. Keep Access Tokens Secure

  • Never commit tokens to git repositories
  • Don’t share tokens via email
  • Regenerate tokens if compromised
  • Use environment variables if possible

FAQ

Q: Do I still need client-side tracking? A: Yes, server-side is supplemental. Keep client-side for:

  • GTM flexibility
  • User interface events (clicks, scrolls)
  • Real-time personalization
  • Full event coverage

Q: Will I see duplicate events? A: No, if configured correctly. ADT uses event_id for automatic deduplication.

Q: How much does this improve tracking? A: Typical improvement: 30-40% more events captured, especially for:

  • iOS users (70%+ improvement)
  • Users with ad blockers (100% improvement)
  • Fast page exits (50%+ improvement)

Q: Does this work with WooCommerce? A: Yes! All WooCommerce events are automatically tracked server-side including:

  • Product views
  • Add to cart
  • Checkout steps
  • Purchases
  • Refunds

Q: Can I use server-side only (no client-side)? A: Not recommended. You’ll lose:

  • User interaction events (clicks, scrolls)
  • Real-time personalization
  • Some GTM features Best practice: Use dual tracking

Q: Is this legal/GDPR compliant? A: Yes, ADT’s implementation:

  • Respects user consent
  • Hashes all PII
  • Can be disabled per-user
  • Complies with GDPR, CCPA, and ePrivacy

Q: Does this cost extra from Meta/Google? A: No! Both Meta CAPI and GA4 MP are free to use.

Support Resources

Documentation:

Testing Tools:

Need Help? Premium users can contact support for:

  • Setup assistance
  • Troubleshooting server-side issues
  • Custom event configuration
  • Enterprise implementation

Quick Start Summary

Meta CAPI (5 Minutes)

  1. Get Meta Access Token from Events Manager
  2. Enable Meta CAPI in ADT Settings
  3. Paste Access Token
  4. Add Test Event Code
  5. Test and verify
  6. Remove test code, go live

GA4 MP (5 Minutes)

  1. Get Measurement ID from GA4
  2. Generate API Secret in GA4
  3. Enable GA4 MP in ADT Settings
  4. Enter Measurement ID and API Secret
  5. Enable debug mode
  6. Test in DebugView
  7. Disable debug mode, go live

Total Setup Time: ~10 minutes for both platforms

Last Updated: 2025
Plugin Version: 1.2+
Premium Feature

Was this article helpful?