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?
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: http://enable-cors.org/server_apache.html
If you do not have access to the server, try this way, http://enable-cors.org/server_php.html
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!