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
- Log in to your Anacoic Dashboard
- Click "+ New Gateway"
- Enter a name (e.g., "Main Website")
- 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
- Toggle Meta CAPI to enabled
- Enter your Pixel ID (found in Events Manager)
- Enter your Access Token (generate in Events Manager → Settings → Generate Access Token)
- Click Save
TikTok Events API
- Toggle TikTok Events to enabled
- Enter your Pixel Code (found in TikTok Ads Manager)
- Enter your Access Token (generate in TikTok Business Center)
- Click Save
Google Enhanced Conversions
- Toggle Google Ads to enabled
- Enter your Conversion ID (e.g.,
AW-123456789) - Enter your Conversion Label
- Enter your Developer Token
- 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:
- Go to the Domains tab
- Add a subdomain like
metrics.yoursite.com - Add the CNAME record to your DNS:
metrics.yoursite.com → your-gateway-id.anacoic.com - Wait for DNS propagation (usually 5-30 minutes)
- 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
- Go to the Simulator tab
- Send a test event
- Check the Live Logs tab to see the event with per-destination status
- 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_idwith each event for deduplication
Next Steps
- Set up Domain Locking for added security
- Configure the Agent Gateway to make your site AI-ready
- Explore Custom Destinations to send events to any webhook