@signalpoint opened this Issue on September 6th 2017

Piwik Version: 3.0.4

If I use the search box on a Custom Dimension to filter for two zip codes, for example: 75202|28203

This works properly and returns results like this screen shot...

screenshot from 2017-09-05 22-20-16

...and uses a URL like the one below:

https://piwik.example.com/index.php?date=2017-09-05&scopeOfDimension=visit&viewDataTable=table&idSite=1&period=month&disableLink=1&module=CustomDimensions&action=getCustomDimension&widget=1&moduleToWidgetize=CustomDimensions&actionToWidgetize=getCustomDimension&idDimension=1&filter_limit=15&filter_sort_column=nb_visits&filter_sort_order=desc&filter_column=label&filter_pattern=75202%7C28203

We can see that the filter_pattern query string parameter is equal to an encoded value of 75202%7C28203

Now if I try to load this widget via an iframe with the following URL...

https://piwik.example.com/index.php?idSite=1&date=2017-09-05&period=month&disableLink=1&module=Widgetize&action=iframe&widget=1&token_auth=abc123&moduleToWidgetize=CustomDimensions&actionToWidgetize=getCustomDimension&idDimension=1&filter_column=label&filter_pattern=75202%7C28203&filter_limit=15

We can see the filter_pattern is encoded with the same value of 75202%7C28203, but this yields no results, and from this screenshot you can see that the value in the search box is not properly decoded.

screenshot from 2017-09-05 22-33-02

Is this perhaps a bug, or am I using the API improperly via an iframe?

@mattab commented on September 18th 2017 Owner

Thanks for the report @signalpoint. Yes, it is a bug. Although we didn't plan for you to do this (and don't yet have automated tests for it), it is an interesting and valid use case and should work.

Powered by GitHub Issue Mirror