DocsGetting StartedQuickstart: Fix Pixel Tracking

Quickstart: Fix Pixel Tracking

Set up ad blocker-proof tracking in under 5 minutes

Fix Pixel Tracking in 5 Minutes

This guide shows you how to bypass ad blockers and restore your conversion tracking using Anacoic's server-side proxy.

Prerequisites

  • A Facebook Pixel ID (or TikTok Pixel, or Google Ads Conversion ID)
  • Access to your website's code or tag manager
  • An Anacoic account (Sign up at anacoic.com)

Step 1: Create a Gateway

  1. Log in to your Anacoic Dashboard
  2. Click "+ New Gateway"
  3. Enter a name (e.g., "Main Website")
  4. Click Create

Your gateway is now live with a default endpoint like:

https://your-gateway-id.anacoic.com/track

Step 2: Connect Your Ad Platform

Navigate to the Integrations tab in your gateway and configure your ad platform:

Meta (Facebook) CAPI

  1. Toggle Meta CAPI to enabled
  2. Enter your Pixel ID (found in Events Manager)
  3. Enter your Access Token (generate in Events Manager → Settings → Generate Access Token)
  4. Click Save

TikTok Events API

  1. Toggle TikTok Events to enabled
  2. Enter your Pixel Code (found in TikTok Ads Manager)
  3. Enter your Access Token (generate in TikTok Business Center)
  4. Click Save

Google Enhanced Conversions

  1. Toggle Google Ads to enabled
  2. Enter your Conversion ID (e.g., AW-123456789)
  3. Enter your Conversion Label
  4. Enter your Developer Token
  5. Click Save

Step 3: Install the Tracking Snippet

Go to the Installation tab and copy the snippet for your preferred method.

JavaScript (Recommended)

Add this to your website's <head>:

<script>
(function(w,d,s,o,f,js,fjs){
  w['AnaTrk']=o;w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
  js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
  js.async=1;js.src=f;fjs.parentNode.insertBefore(js,fjs);
})(window,document,'script','ana','https://YOUR-GATEWAY.anacoic.com/ana.js');

ana('init', 'YOUR-API-KEY');
</script>

Then track events:

// Track a page view
ana('track', 'PageView');

// Track a purchase
ana('track', 'Purchase', {
  value: 99.99,
  currency: 'USD',
  content_ids: ['SKU-123']
});

Server-Side (Node.js)

const response = await fetch('https://YOUR-GATEWAY.anacoic.com/track', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    event_name: 'Purchase',
    event_id: 'unique-123', // For deduplication
    custom_data: {
      value: 99.99,
      currency: 'USD'
    },
    user_data: {
      em: 'customer@example.com' // Will be SHA-256 hashed automatically
    }
  })
});

Step 4: Add a Custom Domain (Optional but Recommended)

For maximum reliability, use your own subdomain:

  1. Go to the Domains tab
  2. Add a subdomain like metrics.yoursite.com
  3. Add the CNAME record to your DNS:
    metrics.yoursite.com → your-gateway-id.anacoic.com
    
  4. Wait for DNS propagation (usually 5-30 minutes)
  5. Update your tracking snippet to use https://metrics.yoursite.com/track

Pro Tip: Custom domains make your tracking requests indistinguishable from first-party requests, dramatically reducing false positives from ad blockers.

Step 5: Verify It's Working

  1. Go to the Simulator tab
  2. Send a test event
  3. Check the Live Logs tab to see the event with per-destination status
  4. Verify in Facebook Events Manager / TikTok Events Manager that events are arriving

Troubleshooting

Events not showing in Facebook?

  • Verify your Access Token hasn't expired
  • Check the Live Logs for error messages
  • Ensure your Pixel ID is correct

Getting 403 errors?

  • If you have Domain Locking enabled, add your website to the allowed origins in the Security tab

Events are duplicated?

  • Make sure you're sending a unique event_id with each event for deduplication

Next Steps