Can't read analytics events, CORS request did not succeed

I’ve enabled analytics on my WebGL project, but I’m not getting any data on my dashboard. This error pops up periodically in the browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cdp.cloud.unity3d.com/v1/events. (Reason: CORS request did not succeed).

This looks like a problem on the Unity server’s side, how do I fix that? I have CORS enabled on my server that’s hosting my project.

We do not support CORS yet. Are you sending custom events from WebGL? If so, you would need to call Analytics.FlushEvents() after every call, a known issue.

Hmm, maybe there is some misunderstanding here? The issue occurs when performing a request from http://www.game.com/ over to https://cdp.cloud.unity3d.com/v1/events . If we say that https://cdp.cloud.unity3d.com/v1/events does not support CORS, then it means that users should

That makes me think, since neither of those scenarios are appropriate, surely we must support CORS on the analytics backend?

To the OP - please describe how you are using Analytics on WebGL. We have many users using Analytics on their server-hosted WebGL games. Are you using Custom Events?

Nevermind, the analytics work despite that error. I guess it just took longer than 24 hours to show up on the dasboard.

Hello. I have the same problem.
After some testing, I found out that exactly 10 minutes after starting my application, Unity Analytics tries to send some request to ‘https://operate-sdk-telemetry.unity3d.com/v1/record’. This happens even when I don’t perform actions in my application.
Please help, what could be wrong?

Here is error from Chrome.

This is my code:

Can you check and see if you have an ad blocker? Perhaps try with a different browser? Are your events not showing in the dashboard?

I have the adblocker turned off, I’m testing my application from inkcognito mode. From other browsers and devices the problem remains. Events are shown in the console and displayed in the dashboard.

Events in console:

7878007--1001842--upload_2022-2-8_10-48-14.png

Events in dashboard:

7878007--1001845--upload_2022-2-8_10-50-30.png

@mkirill97 Thanks for the follow up. Can you try again?