POSTing to piwik.php just hangs

Hello all,

I’m trying to post data to the /piwik.php page and I’m getting nothing but a hanging script. I can visit the page, I can send a query string over GET, but every time I try to post I get nothing. I’ve turned on debugging and still, nothing.

To test, I’ve set up a small page on the same server that just posts the data over an ajax post request and spits back whatever piwik answered with. It’s just spinning without ever ending.

I can run the bulk import tool from the command line on the server and there is no problem.

I’ve also updated to the latest beta, but it wasn’t working before the upgrade either.

For refrence, I’m sending the data from the piwik documentation (firebug output):


{"requests": ["?idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1","?idsite=1&url=http://example.net/test.htm&action_name=Another bul k page view&rec=1"], "token_auth": "mytokenishere"}

Any help would be much appreciated.

John

Ok, I think I see why it wasn’t working from my webpage… same origin policy. But I am also trying to post from a script which is not using javascript/ajax requests, and I’m still getting the same issue.

Made a little more progress this morning with Fiddler 2. I was able to send a post request to piwik.php and get a response:


{"requests": ["?idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1","?idsite=1&url=http://example.net/test.htm&action_name=Another bul k page view&rec=1"], "token_auth": "mytokenhere"}

unfortunately, the response I get is


Debug enabled - Input parameters: <br/>array ( )
token_auth is authenticated!
Loading plugins: { Provider,Goals,UserCountry }
Current datetime: 2013-05-02 14:41:41
[b]The request is invalid: empty request, or maybe tracking is disabled in the config.ini.php via record_statistics=0[/b]
token_auth is authenticated!
Loading plugins: { Provider,Goals,UserCountry }
Current datetime: 2013-05-02 14:41:41
[b]The request is invalid: empty request, or maybe tracking is disabled in the config.ini.php via record_statistics=0[/b]
-> Scheduled tasks not triggered.
Next run will be from: 2013-05-02 15:25:24 UTC
Nothing to notice => default behaviour
End of the page.

I double checked and even put into my config.inc.php that record_statistics = 1, so I’m not sure what I’m doing wrong with this post request, as it’s taken straight from the documentation and validates as json off of jsonlint.

Ok, for anyone who is reading this, found out the problem. The documentation found on the site is incorrect with how the data that gets sent to the server needs to be formatted. I have submitted a request to update the documentation to reflect how the data needs to be submitted here: http://dev.piwik.org/trac/ticket/3922#ticket