@gka opened this Issue on August 4th 2011 Member

I'm currently working on some kind of mini desktop client for Piwik (focus on visualization) and playing a lot with the API. When calling Referers.getRefererType I get something like this (I cut out some metrics. The final point here is, that there is no semantics for the rows in the result:

<result>
    <row>
        <label>Webseiten</label>
        <nb_visits>66</nb_visits>
    </row>
    <row>
        <label>Direkte Zugriffe</label>
        <nb_visits>44</nb_visits>
    </row>
    <row>
        <label>Suchmaschinen</label>
        <nb_visits>19</nb_visits>
    </row>
</result>

There's just the localized labels. Since I want to combine some of the metrics to get a bigger picture, it is necessary for the client to understand the meaning of the values. By now this only could be done by providing the client with a list of all translated versions of the terms "Websites", "Search Engines" and so on.

Wouldn't a more semantic API make more sense? Adding some kind of unique identifier along with the localized name would be a great improvement.

<result>
    <row>
        <id>websites</id>
        <label>Webseiten</label>
        <nb_visits>66</nb_visits>
    </row>
    <row>
        <id>directaccess</id>
        <label>Direkte Zugriffe</label>
        <nb_visits>44</nb_visits>
    </row>
    <row>
        <id>searchengines</id>
        <label>Suchmaschinen</label>
        <nb_visits>19</nb_visits>
    </row>
</result>
@mattab commented on August 21st 2011 Owner

Good point, we should have some kind of standard ID for each row.

There is the same issue in the metadata output.

Thanks for the suggestion

Powered by GitHub Issue Mirror