Get all-time-impressions for given contentName in Matomo Reporting API - matomo

I'd like to request the core metrics for a given contentName in matomos reporting API. ContentName is in this example anwalt:4247, and I send this request:
https://statistics/?method=Contents.getContentNames&segment=contentName==anwalt:4247&label=anwalt:4247&date=2019-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93exx3
gives
[{"label":"anwalt:4247","nb_visits":27,"nb_impressions":37,"nb_interactions":12,"sum_daily_nb_uniq_visitors":27,"interaction_rate":"32,43\u00a0%","segment":"contentName==anwalt%3A4247","idsubdatatable":1}]
or this
https://statistics/?method=Contents.getContentNames&label=anwalt:4247&date=2019-01-01,today&period=range&format=JSON&module=API&idSite=1&format=JSON&token_auth=93exx3
gives
[{"label":"anwalt:4247","nb_visits":21,"nb_impressions":28,"nb_interactions":8,"sum_daily_nb_uniq_visitors":21,"interaction_rate":"28,57\u00a0%","segment":"contentName==anwalt%3A4247","idsubdatatable":282}]
But both numbers are wrong (other than in matomo UI).
Isn't there any simple request for that common task?

What you tried with &date=2019-01-01,today&period=range should work fine, what is the problem in the output data?

Related

Why do I see a bunch of requests to https://clouddebugger.googleapis.com:443 GET /v2/controller/debuggees/gcp*/breakpoints?agentId=* in logging?

We don't have any humans actively debugging our application, yet I see a bunch of requests in our logs to clouddebugger.googleapis.com (or from?).
Anyone know where and why these requests are coming in?
The requests take the following form:
https://clouddebugger.googleapis.com:443 GET /v2/controller/debuggees/gcp*/breakpoints?agentId=*
It looks like these request are coming from GCP's Cloud Debugger API; More specifically, the REST API using the Method: "debugger.debuggees.breakpoints.get" which is used for getting breakpoint information.
It could be that your application that is running (or using) the API to get your codes breakpoint information and send it to Cloud Debugger. I would suggest reviewing your applications code to see if this API is being used anywhere in your application.

Getting 403 not authorized when indexing documents on Retrieve and Rank

I am suddenly getting a 403 error when I try to POST an update to the Retrieve and Rank service. This code is under development but it has been working up until yesterday. The failure occurs only when doing a POST to /v1/solr_clusters/{solr_cluster_id}/solr/{collection_name}/update, and it fails the same way whether I do it via my program, the Swagger API documentation, or cURL. All other operations to this service that I've tried work fine when using the same credentials that I'm using with this POST. The error message I'm getting back is
Error: WRRCSH004: Service [1d111267-76b7-417a-98bd-4e9a58072ef9] is not authorized for cluster [sc262b05e8_dcf5_40b4_b662_ae85058ff07f]!. I don't know where the identifier (1d111267-76b7-417a-98bd-4e9a58072ef9) is coming from; that's not the userid I'm sending in.
Looking into your issue it appears your Bluemix organization has multiple service instances. The 403 issue you were seeing is because you're trying to access a Solr cluster using credentials from one of your instances against a cluster in the other instance. The 1d111267-76b7-417a-98bd-4e9a58072ef9 represents one of these service instances—but the issue is that the cluster you're trying to access is not part of that instance. A good way to test this is to ensure you're using the same credentials that generate the 403 but simply try to list the Solr clusters you have created by doing a GET against https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/.
As for the 500 issue, I wasn't able to see anything on our end. If you're still experiencing that I would suggest posting another question and we can look into things again.
Thanks,
-Scott

Possible to access Piwik getVisitorLog through HTTP API?

I'm building some reporting tool. Ideally I want to avoid going through web server logs myself and use (some of) the power of Piwik.
The stuff I get from the visitor log would be a good start, this is at http://example.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#/module=Live&action=getVisitorLog&idSite=1&period=day&date=yesterday
Unfortunately I can't find a getVisitorLog action in the HTTP API docs at
http://developer.piwik.org/api-reference/reporting-api#Actions (and it's also not an undocumented feature, method=Actions.getVisitorLog gives me
The method 'getVisitorLog' does not exist or is not available in the module '\Piwik\Plugins\Actions\API'.
Is there another way to get to this? Or should I write a plugin for Piwik?
Apparently it is possible through the Live plugin API:
http://developer.piwik.org/api-reference/reporting-api#Live
This works as desired:
http://example.com/piwik/index.php?module=API&method=Live.getLastVisitsDetails&format=JSON&idSite=1&period=day&date=2015-07-21&expanded=1&token_auth=XXXXX&filter_limit=100

How do you get the groupUniqueId for the Google Group Settings API?

I am looking at this API: https://developers.google.com/admin-sdk/groups-settings/v1/reference/groups/get
However, when I try the test at the bottom, it always returns 400 Bad request. I have tried using the Google group email address (without the #gmail.com and with the #gmail.com) for several groups I am in.
How do you find the groupUniqueId for a Google group?
I had the problem yesterday and 'think' I undertood it:
I use the PHP SDK and had to use groupssettings API.
When I executed my query, the PHP answer was something such: "incorrect json format".
Still in my API, I had to FORCE the JSON to be used, by adding optional parameter: alt=json
Then, The query worked.
Until now, this is the only Google API where I had to specify this.
What I suspect is the "Try It" feature to use json, and because the API does NOT returns json by default, it just fails. Too bad there is no way to force json there.

HTTP Error 405 Method not allowed error in admin log

I'm getting a strange error in my newly deployed application in appengine. In the error log it tells me that PageRank, TwitterBot and a couple of others. I would guess this is due to these try to get data using ajax or another async service resulting in "same origin policy"-problem.
My question is does anyone know what these bots are trying to get? For example if pagerank (google page rank I would guess) can't get any info about my application would this effect my page rank. And anyone know what the twitterbot does? And if there is away to handle to provide a proper response?
Most likely, your RequestHandlers (I'm assuming you're using python with webapp from the tags on your earlier questions) aren't implementing a method for whichever request method the bots are using. I'd guess they're HEAD requests, and you have no head() methods defined.

Resources