No 'Access-Control-Allow-Origin'



I’m trying to make requests to Piwik API via Ajax but Piwik doesn’t set ‘Access-Control-Allow-Origin’ field in header.
I modified config.php.ini and added cors_domains[] = * but nothing changed.
What could be wrong?

Thanks in advance


This is a cross-domain problem, I don’t know what document format you used for your Piwik API, if you use JSON, there is a easy solution by using JSONP to fix this problem. Otherwise, you must enable CORS service, to enable this service,
If you do have access to your Apache server, check out this link:
If you do not have access to the server, try this way,


I’ll check apache modules


I forced header to set Access-Control-Allow-Origin field via apache directive for now, but Piwik should send this header via php however, and if it doesn’t, there’s a bug somewhere!

(Matthieu Aubry) #5

Hi there,

a bug was fixed recently and is available in latest beta: I would like to test early beta and RC releases, how do I enable automatic updates to use these development versions? - Analytics Platform - Matomo
this should work now!


I got the latest version of Piwik 2.13 installed, no beta available, but it doesn’t work for me.

I followed the instructions in the Piwik documentation:

How do I configure my Piwik server to allow cross domain requests? (CORS)

But it’s still not working for me.

(Matthieu Aubry) #7

What is the content of your config.ini.php ?

You verified that the CORS headers are not sent in piwik responses?