All questions

Ad blockers are dropping Croct calls from our React SPA, how do people fix it?

Asked by nadia on

Nnadia

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?

Was this helpful?

2 answers

Ddermot_k

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.

Was this helpful?
Hhelena.dev

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.

Was this helpful?
Nnadia

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.

Still have questions?