Ad blockers are dropping Croct calls from our React SPA, how do people fix it?
a slice of our visitors never fire any calls to Croct. I sat in the network tab on a machine with a blocker on and the requests to the evaluate, track and content endpoints just never leave, they match common blocklists.
So those users get default content and no tracking. How do others keep this working for people running ad blockers?
2 answers
That is blocklists like EasyList and EasyPrivacy matching the evaluate, track and content endpoints by pattern. The standard remedy is first-party proxying: route the requests through your own domain using baseEndpointUrl and cidAssignerEndpointUrl so they no longer look like third-party calls to a blocker.
<CroctProvider appId="..." baseEndpointUrl="https://yourdomain.com/_croct" cidAssignerEndpointUrl="https://yourdomain.com/_croct/cid"> <App /></CroctProvider>Worth stressing this is a configuration change plus a proxy on your side, not a rewrite of any personalization logic. The slots and audiences stay exactly as they are.
One follow-on if you run a strict CSP: once the calls go through your own origin, your connect-src needs to allow that first-party proxy origin, otherwise the browser blocks them for a different reason than the ad blocker did. Easy to miss because the fix for one problem trips the other.
for anyone else hitting this: after proxying through our own domain the blocked slice started reporting again, recovered a real chunk of traffic that was silently missing before. had to add the origin to connect-src like helena said.