Closed approached closed 9 years ago
Refference: https://github.com/piwik/piwik/issues/7272
When you make this call on the offical demo, the response is empty too, so this is no issue with this library. See: http://demo.piwik.org/index.php?module=API&method=CustomVariables.getCustomVariablesValuesFromNameId&idSite=7&period=year&format=json&language=de&idSubtable=2&segment=customVariablePageValue1%3D%3D7&date=2014-02-22,2015-02-22
You make it very easy. I hope with this example you feel the spirit.
This is a strange behavior, but since this is the response from the api, the library can't fix it?
Yes it can. Look here https://github.com/piwik/piwik/issues/7272
As far as I understand the comment from mattab, you have to call getCustomVariables
before getCustomVariablesValuesFromNameId
.
So extract the idSubtable
value from this response: http://demo.piwik.org/index.php?module=API&method=CustomVariables.getCustomVariables&idSite=7&period=year&format=json&language=de&idSubtable=2&date=2014-04-22,2015-06-01
In this example idSubtable
for Forum status
is 13947
. With this idSubtable
you get a response for the year range: http://demo.piwik.org/index.php?module=API&method=CustomVariables.getCustomVariablesValuesFromNameId&idSite=7&period=year&format=json&language=de&idSubtable=13947&date=2014-04-22,2015-06-01
Hi@all,
i tried to use Dimension Week/Month/Year on CustomVariables.getCustomVariablesValuesFromNameId but it still don't works. I have every time response with empty arrays.
Request URL: http://exmaple.com/index.php?module=API&method=CustomVariables.getCustomVariablesValuesFromNameId&token_auth=MYTOKEN&idSite=1&period=year&format=json&language=de&idSubtable=2&segment=customVariablePageValue1%3D%3D7&date=2014-02-22,2015-02-22
Only dimension day work it.