Answer the question
In order to leave comments, you need to log in
How to fix Cross-Origin Request Blocked for Yandex Metrica?
After switching from http to https, I saw an error on the site in the Firefox console
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://mc.yandex.ru/webvisor/... (Reason: CORS request failed).
add_header 'Access-Control-Allow-Origin' 'https://mc.yandex.ru';
add_header 'Access-Control-Allow-Methods' "POST, GET, OPTIONS, DELETE, PUT";
add_header 'Access-Control-Allow-Headers' "*";
add_header 'Access-Control-Allow-Credentials' 'true';
Answer the question
In order to leave comments, you need to log in
You definitely do not need this config: you do not need to allow the browser from the mc.yandex.ru domain to read the content of your site.
Here we are talking about the fact that mc.yandex.ru would have to allow requests from your domain. but something went wrong..
- Try clearing your browser cache
- Recheck the domain in Yandex.Metrica settings for your site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question