Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 (Bad Request) #10142

Closed
kira510 opened this issue May 11, 2016 · 5 comments
Closed

400 (Bad Request) #10142

kira510 opened this issue May 11, 2016 · 5 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@kira510
Copy link

kira510 commented May 11, 2016

I recently developed a plugin using dimensions which exports data to another source. I mainly used visit , action dimensions and settings(to set the host name to which piwik data must be exported). The data export happens successfully but i see 400 error on all the piwik tracked websites.
The error i get is
piwik.php:1 GET http://nce45.net/piwik.php?action_name=Dashboard%20Emb…7x971&_cvar=%7B%221%22%3A%5B%22Access%22%2C%22anonymous%22%5D%7D&gt_ms=126 400 (Bad Request)

I get this when i click on the issue
Piwik is a free/libre web analytics that lets you keep control of your data.

Is this because of my plugin? I checked in the forum and did not find any proper solution as such. But many have faced this.

@tsteur
Copy link
Member

tsteur commented May 12, 2016

This can have all sorts of reasons. Do you have access to your error logs? Can you see more information there?

Otherwise you can enable debugging for the tracker as described here http://developer.piwik.org/api-reference/tracking-api#debugging-the-tracker and you might also want to enable logging to files here: http://piwik.org/faq/troubleshooting/faq_115/

@kira510
Copy link
Author

kira510 commented May 13, 2016

Can we manually add plugins that use dimensions into the plugin directory of Piwik? Using dimensions alters the Database but i think it should not create any problems?
Am asking this because i created the plugin and added into the plugins directory of piwik.

@kira510
Copy link
Author

kira510 commented May 17, 2016

Hello @tsteur,
After investigating, i found the error occurs because of action dimension. Visit dimension works fine but i was using action dimension to track the actions of each visitor.
This is my code
//
public function onNewAction(Request $request, Visitor $visitor,Action $action)
{

    // for every action, add one to total number of actions
    $settings = new \Piwik\Plugins\PiwikStatsD\Settings();
    $key1 = $settings->keyName->getValue();
    $actions = $settings->no_of_actions->getValue();
    $idsite = $request->getIdSite();
    $name = Site::getNameFor($idsite);
    $key = $key1."."."$name".".".$actions;

    // get port and host from settings then connect to stats        
    $port = $settings->portName->getValue();
    $host = $settings->hostName->getValue();
    $stats = new StatsD( $host, $port);
    $stats ->counting($key,1,1);

return $action->getActionName();
}

@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Jun 13, 2016
@tsteur
Copy link
Member

tsteur commented Jun 13, 2016

Thx for letting us know what caused the issue. Certainly we have to improve on this part to make it easier to track custom dimensions and to get reports out of it. Especially on the documentation but also the API.

@tsteur tsteur closed this as completed Jun 13, 2016
@kira510
Copy link
Author

kira510 commented Jun 14, 2016

Hello @tsteur ,
The issue was with my code and now with piwik. A mismatch of datatype btween the database and the code caused this issue.
Thanks a lot for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants