Segmenting by Custom Variables Not Working

Make sure you URL encode the “segment” parameter ?

Thanks Matt, urlencoding the whole segment parameter helps.
Im now getting back results for the method ‘getCustomVariablesValuesFromNameId’ when I specify:


;customVariableName1==Player

as well as


;customVariableName1==Player;customVariableValue1==Event1"

Im still a bit confused, as the result I get back for the two calls above is identical (the same is true for when I use the method ‘VisitsSummary.get’).
This is weird as the number of visits for which Event1 is triggered is way less than the total amount that customVariableName1 has been set to “Player”. I can confirm that by looking at the unsegmented custom variable values.

Am I correct in assuming that segmenting with the following parameters should give me back the number of data only for visits where the customVariableValue ‘Event1’ has been set to the name ‘Player’?


;customVariableName1==Player;customVariableValue1==Event1"

Revisiting this issue I realized that URLencoding the segment parameter in fact didn’t solve my issue. I’d made the mistake to URLencode the “segment=” part into “segment%3D”, which just cancelled the whole segmentation and gave back unsegmented results.

I’ve tested with the value of the segment parameter (containing a custom Variable specification) properly encoded, but am still getting back plain zeros. I know there should be visits on this segment as I can see it in the GUI when I inspect Custom Variable for the specified date.

This is the call Im making:


[myPiwik]?module=API&method=VisitsSummary.get&idSite=3&period=day&date=2014-03-25&expanded=1&format=xml&token_auth=[myToken]&segment=customVariableName1%3D%3DPlayer%3BcustomVariableValue1%3D%3DEvent1

Has anyone successfully segemented by custom variables?

Im running piwik 2.2.2 btw.