Piwik custom dimension and segments

We use Piwik cloud (innocraft.com) for analytics and have a custom dimension called channel_perm_id with scope Visit, it’s called dimension1 and is transmitted via JS Tracking API. Using the piwik admin panel we can verify that the dimension is set correctly and transmitted by each visitor.

Now we want to query based on this dimension1 aka channel_perm_id:

curl -i https://###.innocraft.cloud/index.php?segment=dimension1==2ceb64954d4e46f49bc6afa310cf92f&token_auth=###&format=xml&date=today&period=day&idSite=8&module=API&method=VisitsSummary.get

The important part is


which causes this query to return an empty response:


Without the segment parameter the response looks like:


It looks like the custom dimension is somehow not aggregated in piwik.

But if we use the Live module (Live.getCounters instead of VisitsSummary.get), the query works fine.

So we think it has something to do with the scope maybe.

Any ideas are highly appreciated!

Is the segment correctly displayed in the reports when you use the GUI Segment-Editor?

Hi, when i create a segment with channel_perm_id and use an „is“ condition everything is showed correctly, but it is an fixed segment. I need on the fly segmentation, which should work just fine according to the docs. I could use custom variables but im not sure if this is the correct way…

The segment in the GUI is exactly the same as the request to the API. Have a look at the segmented requests, if you can spot a difference in the segment parameter of the URL (your API request vs the GUI segment editor generated request).

Good advice. Well, the GUI defined segment indeed shows the same problem, so only live data (Vistor log…) can be selected using this segment, all other data show “There is no data for this report.”

This means, the data is obviously not aggregated … Hm. As I said, we are using Piwik Cloud, can it be configured somehow ??


@chrisprobst I forwarded your question to the Piwik Cloud staff, you should get an answer soon.

1 Like

Hi Chris, We’ve sent you a message to follow up on this, thanks @peterbo for letting us know