Hi, I'm trying to use a context enricher
Hi, I'm trying to use a context enricher to remove the referrer property when the traffic is coming from a payment processor in order to prevent it from showing up in Google Analytics as traffic. This is the context enricher worker I wrote:
I've added it to Zaraz settings (see attached screenshot) but nothing seems to be happening, the blocked referrers still show up in Google Analytics. Any help would be most welcome.
const referrerList = [
'pay.skrill.com',
'commerce.coinbase.com',
'paymentpage.ecommpay.com',
];
function checkReferrer({ system, client }) {
if (referrerList.some((referrer) => system.page.referrer.includes(referrer))) {
system.page.referrer = '';
}
return { client, system };
}
export default {
async fetch(request, env, ctx) {
const { system, client } = await request.json();
const newContext = checkReferrer({ system, client });
return new Response(JSON.stringify(newContext));
}
};I've added it to Zaraz settings (see attached screenshot) but nothing seems to be happening, the blocked referrers still show up in Google Analytics. Any help would be most welcome.

