Back to Blog
    TikTok
    Server-Side Tracking
    sGTM
    Events API
    Tutorial
    Privacy

    Complete Guide to TikTok Server-Side Tracking with sGTM & Taggian

    August 17, 2025
    10 min read
    Tutorial

    TikTok server-side tracking ensures accurate conversion measurement and GDPR compliance for your ad campaigns. By implementing the TikTok Events API alongside the traditional TikTok Pixel, you can capture more reliable data while reducing losses from third-party cookie restrictions and iOS tracking limitations.

    Why TikTok Server-Side Tracking Matters

    Better Data Quality

    Recover conversion data lost to ad blockers and browser restrictions

    Privacy Compliance

    Meet GDPR requirements with server-to-server data transmission

    Campaign Optimization

    Enhanced conversion tracking improves TikTok's algorithm performance

    Step 1: Create Google Tag Manager Server Container

    The first step is creating a server container to manage your server-side tags. With a server container, you can place tags on your website without modifying code, managing everything from one central location.

    Server Container Setup

    Pro Tip

    A solid server-side tracking foundation is essential for success. Consider following our complete 7-step guide for setting up server-side tracking infrastructure.

    Step 2: Host Your Container on Taggian

    Taggian provides EU-compliant sGTM hosting with automated deployment and managed infrastructure. This eliminates the complexity of server setup while ensuring GDPR compliance.

    Taggian Deployment Process

    DNS Configuration Example
    CNAME analytics.yourdomain.com → your-container.taggian.eu
    # Replace with your actual domain and Taggian endpoint

    Step 3: Install the TikTok Pixel

    The TikTok Pixel is essential for tracking visitor actions on your website, such as viewing products or completing purchases. This traditional tracking method works alongside server-side tracking for comprehensive data collection.

    TikTok Pixel Implementation

    Standard TikTok Events
    • ViewContent — Product page views
    • AddToCart — Add to shopping cart
    • InitiateCheckout — Begin checkout process
    • Purchase — Completed transactions
    • Subscribe — Newsletter signups
    • SubmitForm — Form completions

    Step 4: Set up the TikTok Events API

    The TikTok Events API sends conversion data directly from your server to TikTok, providing more reliable tracking than pixel-only implementations. This server-to-server approach bypasses browser restrictions and ad blockers.

    Events API Setup Process

    1. Get Access Token: In TikTok Ads Manager, navigate to Assets → Events → Manage and generate an Events API access token
    2. Install Events API Tag: In your GTM server container, add the TikTok Events API tag template from the Community Template Gallery
    3. Configure Authentication: Add your access token and TikTok Pixel ID to the tag configuration
    4. Set up Event Parameters: Map your website events to TikTok's standard events (Purchase, ViewContent, etc.)
    5. Configure User Data: Set up customer information parameters like email, phone, and external_id for better matching

    Recommended Data Parameters

    Event Data:
    • Event name (Purchase, ViewContent)
    • Event time (server timestamp)
    • Value and currency
    • Content IDs and categories
    User Data (Hashed):
    • Email address (SHA256)
    • Phone number (SHA256)
    • External ID (customer ID)
    • IP address and user agent
    Privacy & Security

    The Events API automatically hashes personal data (email, phone) using SHA256 before transmission. This ensures GDPR compliance while maintaining data utility for audience matching.

    Step 5: Ensure Event Deduplication

    Event deduplication prevents the same conversion from being counted twice when using both TikTok Pixel and Events API. This ensures clean, accurate reporting and prevents inflated conversion metrics.

    Why Deduplication Matters

    When running both TikTok Pixel and Events API simultaneously (recommended setup), the same user action could be tracked twice — once by the pixel and once by the server. This leads to duplicate conversion counting and skewed campaign performance data.

    Implementing Event Deduplication

    1. Generate Event ID: Create a unique identifier for each conversion event (e.g., order ID, timestamp-based ID)
    2. Add to Pixel Code: Include the event_id parameter in your TikTok Pixel events on the client-side
    3. Include in Events API: Send the same event_id with your server-side Events API calls
    4. Configure in GTM: Set up your server container to pass through the event_id from client requests
    5. Test Deduplication: Verify that identical events with matching event_id values are deduplicated in TikTok reporting

    Event ID Best Practices

    Good Event IDs:
    • Order numbers (e.g., "order_12345")
    • Timestamp + user ID combinations
    • UUID v4 generated client-side
    • Sequential numbers with prefixes
    Requirements:
    • Unique across all events
    • Consistent between pixel and API
    • Alphanumeric, max 64 characters
    • Available on both client and server
    Deduplication Result

    With proper deduplication, TikTok will automatically identify and merge duplicate events, showing you clean, accurate conversion data that reflects true campaign performance.

    Step 6: Test Your Settings

    Testing is crucial to ensure your TikTok server-side tracking implementation works correctly. Proper testing prevents data loss and ensures accurate campaign measurement from day one.

    Testing Process

    Signs of Success

    • Events appear in Test Events dashboard
    • Event parameters are correctly formatted
    • User data is properly hashed
    • Duplicate events are deduplicated
    • Server response codes are 200

    Common Issues

    • Missing or incorrect access token
    • Malformed event parameters
    • Incorrect Pixel ID configuration
    • Event_id mismatch between channels
    • CORS or domain restrictions

    Key Takeaways

    Complete Setup This guide covers TikTok server-side tracking implementation using Google Tag Manager server containers hosted on Taggian, providing enhanced conversion accuracy and GDPR compliance.

    Dual Implementation Running both TikTok Pixel and Events API simultaneously maximizes data capture while event deduplication ensures clean reporting and accurate conversion metrics.

    Data Benefits Server-side tracking recovers conversion data lost to ad blockers, improves campaign optimization through better data quality, and enables integration with CRM and other data sources.

    Privacy Compliance Server-to-server data transmission with automatic hashing ensures GDPR compliance while maintaining data utility for audience targeting and campaign optimization.

    Taggian Advantage EU-hosted infrastructure with automated deployment, managed scaling, and built-in GDPR compliance makes server-side tracking accessible without complex infrastructure management.

    Ready to Implement TikTok Server-Side Tracking?

    Start improving your TikTok campaign performance with accurate server-side tracking. Taggian makes it easy to deploy and manage your SGTM infrastructure in the EU.

    Related Articles