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
- Go to Meta Events Manager
- Select your Data Source (your pixel)
- Click Settings tab
- Scroll to Conversions API
- Click Generate Access Token
- 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
- Go to WordPress Admin → ADT Settings
- Click the Pixel Tracking tab
- Scroll to Meta Conversions API (Server-Side) section
- Check Enable Meta Conversions API
- Paste your Meta Access Token
- (Optional) Add Test Event Code for testing
Step 3: Test Your Setup
- In Meta Events Manager, go to Test Events
- Copy your Test Event Code
- Paste it in ADT Settings (Meta CAPI section)
- Save Settings
- Visit your site and trigger an event (add to cart, purchase, etc.)
- Check Meta Events Manager → Test Events – you should see the event appear!
Step 4: Go Live
- Remove the Test Event Code from ADT Settings
- Save Settings
- 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
- Go to Google Analytics
- Click Admin (bottom left)
- Under Property, click Data Streams
- Click your Web Stream
- Copy the Measurement ID (format:
G-XXXXXXXXXX)
Step 2: Generate API Secret
While still in your Data Stream:
- Scroll down to Measurement Protocol API secrets
- Click Create
- Give it a name (e.g., “ADT Server-Side”)
- Click Create
- Copy the Secret Value
Step 3: Configure in WordPress
- Go to WordPress Admin → ADT Settings
- Click the Pixel Tracking tab
- Scroll to GA4 Measurement Protocol (Server-Side) section
- Check Enable GA4 Measurement Protocol
- Enter your GA4 Measurement ID (G-XXXXXXXXXX)
- Enter your GA4 API Secret
- Save Settings
Step 4: Test Your Setup
Option A: Use Debug Mode
- Check GA4 Debug Mode in ADT Settings
- Save Settings
- Trigger an event on your site
- Go to GA4 → Configure → DebugView
- You should see your event appear!
Option B: Check Real-Time Reports
- Go to GA4 → Reports → Realtime
- Trigger an event on your site
- Within 10 seconds, it should appear in real-time reports
Step 5: Go Live
- Uncheck GA4 Debug Mode
- Save Settings
- 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:
- Go to ADT Settings → Pixel Tracking tab
- Scroll to GA4 Measurement Protocol section
- Check Enable Dual Tracking (Client + Server)
- 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 completedAddToCart– Item added to cartInitiateCheckout– Checkout startedViewContent– Product page viewed
Form Events:
Lead– Form submittedCompleteRegistration– User registered
Standard Events:
PageView– Page loaded
GA4 Measurement Protocol
E-commerce Events:
purchase– Transaction completedadd_to_cart– Item added to cartview_item– Product viewedbegin_checkout– Checkout startedadd_payment_info– Payment stepadd_shipping_info– Shipping step
Form Events:
form_submit– Form completedsign_up– User registeredlogin– User logged in
Standard Events:
page_view– Page loadedsearch– 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:
- Verify access token is correct (starts with
EAA...) - Check Meta pixel ID matches your pixel
- Ensure premium license is active
- Check WordPress debug log for errors
- Verify consent is granted (CAPI respects GDPR)
Problem: Low Event Match Quality
Solutions:
- Enable email collection on forms
- Use Meta’s Advanced Matching features
- Include phone numbers in form data
- Collect ZIP codes for geographic matching
GA4 MP Issues
Problem: Events not appearing in GA4
Solutions:
- Verify Measurement ID is correct (format: G-XXXXXXXXXX)
- Verify API Secret is correct
- Check DebugView with debug mode enabled
- Wait 24-48 hours for standard reports (real-time should be instant)
- Ensure client_id is being generated properly
Problem: Events are duplicated
Solutions:
- Ensure
event_idis being sent - Check if dual tracking is properly configured
- Verify only one instance of ADT is active
- Check if GTM container has conflicting tags
General Issues
Problem: Server-side tracking not working at all
Solutions:
- ✅ Verify premium license is active
- ✅ Check that server-side tracking is enabled in settings
- ✅ Ensure PHP version is 7.4+ (required for server-side)
- ✅ Check WordPress debug log for PHP errors
- ✅ Verify AJAX endpoints are not blocked by security plugins
How to check debug log:
- Enable WordPress debug mode (add to
wp-config.php):
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
- Check
/wp-content/debug.logfor 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:
- ✅ GTM container working
- ✅ GA4 tracking verified
- ✅ Meta pixel firing
- ✅ Events appearing in reports
- → THEN enable server-side
2. Use Dual Tracking Initially
When first enabling server-side:
- Enable dual tracking mode
- Monitor both client and server events
- Verify deduplication is working
- After 7 days, decide if you want server-only or keep dual
3. Monitor Event Match Quality
For Meta CAPI:
- Check Events Manager weekly
- Aim for Event Match Quality > 6.0
- Improve by collecting more user data (email, phone, ZIP)
- 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:
- Meta Events Manager – Test Events
- GA4 DebugView
- [ADT Debug Overlay](enable in ADT Settings)
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)
- Get Meta Access Token from Events Manager
- Enable Meta CAPI in ADT Settings
- Paste Access Token
- Add Test Event Code
- Test and verify
- Remove test code, go live
GA4 MP (5 Minutes)
- Get Measurement ID from GA4
- Generate API Secret in GA4
- Enable GA4 MP in ADT Settings
- Enter Measurement ID and API Secret
- Enable debug mode
- Test in DebugView
- Disable debug mode, go live
Total Setup Time: ~10 minutes for both platforms
Last Updated: 2025
Plugin Version: 1.2+
Premium Feature