Server-side tracking sends events directly from the Analyzely server to Google Analytics 4, bypassing browser limitations and ad blockers. This provides more accurate and complete tracking data.

Note: Server-Side Tracking is a Pro plan feature. Upgrade your plan to access this feature.

Overview

Server-side tracking offers several advantages:

  • More accurate data: Not blocked by ad blockers or browser privacy features
  • Better conversion tracking: Critical purchase events are reliably captured
  • Refund tracking: Enables tracking of refunds (not possible client-side)
  • Improved attribution: More complete data for attribution models
  • Privacy compliance: Works with consent frameworks

How Server-Side Tracking Works

Client-Side (Traditional) Tracking

Customer's Browser → Google Analytics
         ↑
   (can be blocked)

Server-Side Tracking

Customer's Browser → Shopify → Analyzely Server → Google Analytics
                                      ↑
                              (cannot be blocked)

Combined Approach

Analyzely uses both client-side and server-side tracking:

  • Client-side: Captures browse events (page views, product views)
  • Server-side: Captures critical events (purchases, refunds)

This hybrid approach provides comprehensive coverage.

Prerequisites

Before enabling server-side tracking:

  1. Active Pro subscription (Monthly or Yearly)
  2. Google account connected
  3. Measurement ID configured
  4. For auto-setup: Edit permission granted to Google Analytics

Accessing Server-Side Settings

  1. Open the Analyzely app from your Shopify Admin
  2. Go to Analytics Setup
  3. Find the Server-Side Events section

Enabling Server-Side Events

Step 1: Toggle Server-Side Events

  1. Locate the Server-Side Events toggle
  2. Click to switch it to ON
  3. The toggle will show “Enabled” with a green badge

Step 2: Configure the API Secret

The Measurement Protocol API Secret is required for server-side events.

Automatic Setup (Recommended)

If using automatic Measurement ID:

  1. The API secret may be fetched automatically
  2. The field will populate with the secret value
  3. If auto-fetch succeeds, you will see a confirmation message

Manual Setup

If you need to enter the API secret manually:

  1. Go to Google Analytics
  2. Click Admin (gear icon)
  3. In the Property column, click Data Streams
  4. Click on your web stream
  5. Scroll down and click Measurement Protocol API secrets
  6. Click Create to generate a new secret
  7. Give it a name (e.g., “Analyzely Server-Side”)
  8. Copy the secret value
  9. Paste it into the API secret field in Analyzely

Step 3: Save Your Settings

  1. Click Save in the save bar
  2. Wait for confirmation
  3. Server-side events are now active

Creating an API Secret in Google Analytics

Detailed Steps

  1. Access Google Analytics Admin
  2. Navigate to Data Streams
    • In the Property column, click Data Streams
    • Click on your web data stream
  3. Access Measurement Protocol
    • Scroll down in the stream details
    • Click Measurement Protocol API secrets
  4. Create New Secret
    • Click Create button
    • Enter a nickname (e.g., “Analyzely Server-Side”)
    • Click Create
  5. Copy the Secret
    • The secret value will be displayed
    • Click the copy icon to copy it
    • Paste into Analyzely

Important: Treat the API secret like a password. Do not share it publicly.

What Events Use Server-Side Tracking

Purchase Event

The most critical event for server-side tracking:

  • Why: Captures revenue even if customer has ad blockers
  • How: Triggered when Shopify confirms the order
  • Data: Full transaction details, products, revenue

Refund Event

Only available with server-side tracking:

  • Why: Refunds happen after customer leaves (no client-side)
  • How: Triggered when you process a refund in Shopify
  • Data: Transaction ID, refund amount, products

Checkout Events (When Server-Side Enabled)

Additional accuracy for:

  • Begin checkout
  • Add shipping info
  • Add payment info

Understanding the Hybrid Approach

Events by Tracking Method

Event Client-Side Server-Side
View Category Yes No
View Product Yes No
Search Yes No
Add to Cart Yes No
Begin Checkout Yes Yes (enhanced)
Shipping Info Yes Yes (enhanced)
Payment Info Yes Yes (enhanced)
Purchase Yes Yes (primary)
Refund No Yes (only)

Why Both Matter

  • Client-side: Faster, captures browsing behavior immediately
  • Server-side: More reliable, captures transactions accurately

Together, they provide the most complete picture.

Verifying Server-Side Events

In Analyzely Dashboard

Check the Analytics Setup Overview:

  • Server-side events should show as “Enabled”
  • Green checkmark indicates active status

In Google Analytics Realtime

  1. Go to GA4 > Reports > Realtime
  2. Make a test purchase on your store
  3. Look for the purchase event
  4. Server-side events may have a slight delay (seconds)

In Google Analytics Debug View

  1. Go to GA4 > Admin > DebugView
  2. Make a test transaction
  3. Server-side events will appear with server indicators

Common Issues and Solutions

API Secret Not Working

Symptoms: Events not appearing, error messages

Solutions:

  1. Verify the secret is copied correctly (no extra spaces)
  2. Ensure the secret is from the correct property
  3. Try creating a new secret
  4. Check that the data stream matches your Measurement ID

Events Still Being Blocked

Understanding: Server-side purchase events should always work

If still having issues:

  1. Verify server-side is enabled (toggle ON)
  2. Check API secret is saved
  3. Wait a few minutes for events to process
  4. Check Google Analytics Realtime

Duplicate Events

Symptoms: Same purchase appearing twice

Solutions:

  1. This is usually prevented automatically
  2. Server-side events use transaction ID for deduplication
  3. Check for other GA implementations on your store
  4. Remove any manual GA purchase tracking code

Permission Denied for Auto-Setup

Symptoms: Cannot automatically fetch API secret

Solutions:

  1. Re-authenticate with Google
  2. Grant “Manage Analytics” permission
  3. Or use manual API secret setup

Best Practices

Always Enable for Accuracy

Server-side tracking should be enabled if you have a Pro plan:

  • Improves data accuracy by 10-30%
  • Captures events blocked by ad blockers
  • Essential for reliable revenue tracking

Keep API Secret Secure

  • Do not share the secret publicly
  • Do not include in client-side code
  • Regenerate if compromised

Monitor for Issues

Regularly check:

  • Dashboard shows server-side enabled
  • Realtime events are appearing
  • Revenue data matches Shopify reports

Test After Changes

After any configuration changes:

  1. Make a test purchase
  2. Verify it appears in GA4
  3. Check refund tracking if applicable

Impact on Your Data

Before Server-Side

  • Some purchases may be missed (ad blockers)
  • Refunds cannot be tracked
  • Data may be 10-30% lower than actual

After Server-Side

  • Nearly all purchases captured
  • Refunds tracked automatically
  • Data matches reality more closely

Data Comparison

Metric Client-Only With Server-Side
Purchase tracking 70-90% 95-99%+
Revenue accuracy Lower Higher
Refund tracking Not possible Fully tracked
Ad blocker impact High Minimal

Technical Details

How It Works

  1. Purchase happens: Customer completes checkout
  2. Shopify webhook: Shopify notifies Analyzely
  3. Server processing: Analyzely formats the event
  4. Measurement Protocol: Event sent to GA4 using API secret
  5. GA4 receives: Event processed and attributed

Measurement Protocol

Server-side events use Google’s Measurement Protocol:

  • Direct API communication
  • Secure and authenticated
  • Supports all eCommerce parameters

Event Timing

  • Client-side: Immediate (on page load)
  • Server-side: 1-30 seconds (after Shopify confirmation)