@mattab opened this Issue on May 25th 2016 Owner

See this forum post for details: https://forum.piwik.org/t/set-the-order-of-columns-in-export/8020

Reproduce

I haven't checked, but maybe this issue occurs only for the API Live.getLastVisitsDetails? cc @piwikjapan

Proposed solution

Columns should be displayed in a consistent order in our exported API data sets.

@mattab commented on May 25th 2016 Owner

In the first file we have the following columns:

        idVisit
        visitIp
        visitorId
        type (actionDetails 0)
        url (actionDetails 0)
        pageTitle (actionDetails 0)
        pageIdAction (actionDetails 0)
        serverTimePretty (actionDetails 0)
        pageId (actionDetails 0)
        generationTime (actionDetails 0)
        icon (actionDetails 0)
        timestamp (actionDetails 0)
        goalConversions
        siteCurrency
        siteCurrencySymbol
        serverDate
        visitServerHour
        lastActionTimestamp
        lastActionDateTime
        userId
        visitorType
        visitorTypeIcon
        visitConverted
        visitConvertedIcon
        visitCount
        firstActionTimestamp
        visitEcommerceStatus
        visitEcommerceStatusIcon
        daysSinceFirstVisit
        daysSinceLastEcommerceOrder
        visitDuration
        visitDurationPretty
        searches
        actions
        referrerType
        referrerTypeName
        referrerName
        referrerKeyword
        referrerKeywordPosition
        referrerUrl
        referrerSearchEngineUrl
        referrerSearchEngineIcon
        languageCode
        language
        deviceType
        deviceTypeIcon
        deviceBrand
        deviceModel
        operatingSystem
        operatingSystemName
        operatingSystemIcon
        operatingSystemCode
        operatingSystemVersion
        browserFamily
        browserFamilyDescription
        browser
        browserName
        browserIcon
        browserCode
        browserVersion
        events
        continent
        continentCode
        country
        countryCode
        countryFlag
        region
        regionCode
        city
        location
        latitude
        longitude
        visitLocalTime
        visitLocalHour
        daysSinceLastVisit
        customVariableName3 (customVariables 3)
        customVariableValue3 (customVariables 3)
        resolution
        plugins
        pluginIcon (pluginsIcons 0)
        pluginName (pluginsIcons 0)
        pluginIcon (pluginsIcons 1)
        pluginName (pluginsIcons 1)
        provider
        providerName
        providerUrl
        serverTimestamp
        serverTimePretty
        serverDatePretty
        serverDatePrettyFirstAction
        serverTimePrettyFirstAction
        timeSpent (actionDetails 0)
        timeSpentPretty (actionDetails 0)
        pluginIcon (pluginsIcons 2)
        pluginName (pluginsIcons 2)
        pluginIcon (pluginsIcons 3)
        pluginName (pluginsIcons 3)
        pluginsIcons
        type (actionDetails 1)
        url (actionDetails 1)
        pageTitle (actionDetails 1)
        pageIdAction (actionDetails 1)
        serverTimePretty (actionDetails 1)
        pageId (actionDetails 1)
        generationTime (actionDetails 1)
        icon (actionDetails 1)
        timestamp (actionDetails 1)
        timeSpent (actionDetails 1)
        timeSpentPretty (actionDetails 1)
        type (actionDetails 2)
        url (actionDetails 2)
        pageTitle (actionDetails 2)
        pageIdAction (actionDetails 2)
        serverTimePretty (actionDetails 2)
        pageId (actionDetails 2)
        generationTime (actionDetails 2)
        timeSpent (actionDetails 2)
        timeSpentPretty (actionDetails 2)
        icon (actionDetails 2)
        timestamp (actionDetails 2)
        type (actionDetails 3)
        url (actionDetails 3)
        pageTitle (actionDetails 3)
        pageIdAction (actionDetails 3)
        serverTimePretty (actionDetails 3)
        pageId (actionDetails 3)
        generationTime (actionDetails 3)
        timeSpent (actionDetails 3)
        timeSpentPretty (actionDetails 3)
        icon (actionDetails 3)
        timestamp (actionDetails 3)
        type (actionDetails 4)
        url (actionDetails 4)
        pageTitle (actionDetails 4)
        pageIdAction (actionDetails 4)
        serverTimePretty (actionDetails 4)
        pageId (actionDetails 4)
        generationTime (actionDetails 4)
        timeSpent (actionDetails 4)
        timeSpentPretty (actionDetails 4)
        icon (actionDetails 4)
        timestamp (actionDetails 4)
        type (actionDetails 5)
        url (actionDetails 5)
        pageTitle (actionDetails 5)
        pageIdAction (actionDetails 5)
        serverTimePretty (actionDetails 5)
        pageId (actionDetails 5)
        generationTime (actionDetails 5)
        timeSpent (actionDetails 5)
        timeSpentPretty (actionDetails 5)
        icon (actionDetails 5)
        timestamp (actionDetails 5)
        type (actionDetails 6)
        url (actionDetails 6)
        pageTitle (actionDetails 6)
        pageIdAction (actionDetails 6)
        serverTimePretty (actionDetails 6)
        pageId (actionDetails 6)
        generationTime (actionDetails 6)
        timeSpent (actionDetails 6)
        timeSpentPretty (actionDetails 6)
        icon (actionDetails 6)
        timestamp (actionDetails 6)
        type (actionDetails 7)
        url (actionDetails 7)
        pageTitle (actionDetails 7)
        pageIdAction (actionDetails 7)
        serverTimePretty (actionDetails 7)
        pageId (actionDetails 7)
        generationTime (actionDetails 7)
        timeSpent (actionDetails 7)
        timeSpentPretty (actionDetails 7)
        icon (actionDetails 7)
        timestamp (actionDetails 7)
        pluginIcon (pluginsIcons 4)
        pluginName (pluginsIcons 4)

In the second file

        idSite
        idVisit
        visitIp
        visitorId
        type (actionDetails 0)
        url (actionDetails 0)
        pageTitle (actionDetails 0)
        pageIdAction (actionDetails 0)
        serverTimePretty (actionDetails 0)
        pageId (actionDetails 0)
        generationTime (actionDetails 0)
        timeSpent (actionDetails 0)
        timeSpentPretty (actionDetails 0)
        icon (actionDetails 0)
        timestamp (actionDetails 0)
        type (actionDetails 1)
        url (actionDetails 1)
        pageTitle (actionDetails 1)
        pageIdAction (actionDetails 1)
        serverTimePretty (actionDetails 1)
        pageId (actionDetails 1)
        generationTime (actionDetails 1)
        timeSpent (actionDetails 1)
        timeSpentPretty (actionDetails 1)
        icon (actionDetails 1)
        timestamp (actionDetails 1)
        type (actionDetails 2)
        url (actionDetails 2)
        pageTitle (actionDetails 2)
        pageIdAction (actionDetails 2)
        serverTimePretty (actionDetails 2)
        pageId (actionDetails 2)
        generationTime (actionDetails 2)
        timeSpent (actionDetails 2)
        timeSpentPretty (actionDetails 2)
        icon (actionDetails 2)
        timestamp (actionDetails 2)
        type (actionDetails 3)
        url (actionDetails 3)
        pageTitle (actionDetails 3)
        pageIdAction (actionDetails 3)
        serverTimePretty (actionDetails 3)
        pageId (actionDetails 3)
        generationTime (actionDetails 3)
        icon (actionDetails 3)
        timestamp (actionDetails 3)
        goalConversions
        siteCurrency
        siteCurrencySymbol
        serverDate
        visitServerHour
        lastActionTimestamp
        lastActionDateTime
        userId
        visitorType
        visitorTypeIcon
        visitConverted
        visitConvertedIcon
        visitCount
        firstActionTimestamp
        visitEcommerceStatus
        visitEcommerceStatusIcon
        daysSinceFirstVisit
        daysSinceLastEcommerceOrder
        visitDuration
        visitDurationPretty
        searches
        actions
        referrerType
        referrerTypeName
        referrerName
        referrerKeyword
        referrerKeywordPosition
        referrerUrl
        referrerSearchEngineUrl
        referrerSearchEngineIcon
        languageCode
        language
        deviceType
        deviceTypeIcon
        deviceBrand
        deviceModel
        operatingSystem
        operatingSystemName
        operatingSystemIcon
        operatingSystemCode
        operatingSystemVersion
        browserFamily
        browserFamilyDescription
        browser
        browserName
        browserIcon
        browserCode
        browserVersion
        events
        continent
        continentCode
        country
        countryCode
        countryFlag
        region
        regionCode
        city
        location
        latitude
        longitude
        visitLocalTime
        visitLocalHour
        daysSinceLastVisit
        customVariableName3 (customVariables 3)
        customVariableValue3 (customVariables 3)
        resolution
        plugins
        pluginIcon (pluginsIcons 0)
        pluginName (pluginsIcons 0)
        pluginIcon (pluginsIcons 1)
        pluginName (pluginsIcons 1)
        provider
        providerName
        providerUrl
        serverTimestamp
        serverTimePretty
        serverDatePretty
        serverDatePrettyFirstAction
        serverTimePrettyFirstAction
        timeSpent (actionDetails 3)
        timeSpentPretty (actionDetails 3)
        pluginIcon (pluginsIcons 2)
        pluginName (pluginsIcons 2)
        pluginIcon (pluginsIcons 3)
        pluginName (pluginsIcons 3)
        siteSearchKeyword (actionDetails 2)
        siteSearchKeyword (actionDetails 3)
        type (actionDetails 4)
        url (actionDetails 4)
        pageTitle (actionDetails 4)
        pageIdAction (actionDetails 4)
        serverTimePretty (actionDetails 4)
        pageId (actionDetails 4)
        generationTime (actionDetails 4)
        timeSpent (actionDetails 4)
        timeSpentPretty (actionDetails 4)
        icon (actionDetails 4)
        timestamp (actionDetails 4)
        type (actionDetails 5)
        url (actionDetails 5)
        pageIdAction (actionDetails 5)
        serverTimePretty (actionDetails 5)
        pageId (actionDetails 5)
        siteSearchKeyword (actionDetails 5)
        generationTime (actionDetails 5)
        timeSpent (actionDetails 5)
        timeSpentPretty (actionDetails 5)
        icon (actionDetails 5)
        timestamp (actionDetails 5)
        type (actionDetails 6)
        url (actionDetails 6)
        pageTitle (actionDetails 6)
        pageIdAction (actionDetails 6)
        serverTimePretty (actionDetails 6)
        pageId (actionDetails 6)
        generationTime (actionDetails 6)
        timeSpent (actionDetails 6)
        timeSpentPretty (actionDetails 6)
        icon (actionDetails 6)
        timestamp (actionDetails 6)
        type (actionDetails 7)
        url (actionDetails 7)
        pageIdAction (actionDetails 7)
        serverTimePretty (actionDetails 7)
        pageId (actionDetails 7)
        siteSearchKeyword (actionDetails 7)
        generationTime (actionDetails 7)
        timeSpent (actionDetails 7)
        timeSpentPretty (actionDetails 7)
        icon (actionDetails 7)
        timestamp (actionDetails 7)
        type (actionDetails 8)
        url (actionDetails 8)
        pageTitle (actionDetails 8)
        pageIdAction (actionDetails 8)
        serverTimePretty (actionDetails 8)
        pageId (actionDetails 8)
        generationTime (actionDetails 8)
        timeSpent (actionDetails 8)
        timeSpentPretty (actionDetails 8)
        icon (actionDetails 8)
        timestamp (actionDetails 8)
        pluginIcon (pluginsIcons 4)
        pluginName (pluginsIcons 4)
        pageTitle (actionDetails 5)
        siteSearchKeyword (actionDetails 1)

Indeed the orders are different:

$ diff ~/Desktop/first ~/Desktop/second 
1c1,4
< idSite
---
> 
>     
>     
>         idSite
11a15,16
>         timeSpent (actionDetails 0)
>         timeSpentPretty (actionDetails 0)
13a19,49
>         type (actionDetails 1)
>         url (actionDetails 1)
>         pageTitle (actionDetails 1)
>         pageIdAction (actionDetails 1)
>         serverTimePretty (actionDetails 1)
>         pageId (actionDetails 1)
>         generationTime (actionDetails 1)
>         timeSpent (actionDetails 1)
>         timeSpentPretty (actionDetails 1)
>         icon (actionDetails 1)
>         timestamp (actionDetails 1)
>         type (actionDetails 2)
>         url (actionDetails 2)
>         pageTitle (actionDetails 2)
>         pageIdAction (actionDetails 2)
>         serverTimePretty (actionDetails 2)
>         pageId (actionDetails 2)
>         generationTime (actionDetails 2)
>         timeSpent (actionDetails 2)
>         timeSpentPretty (actionDetails 2)
>         icon (actionDetails 2)
>         timestamp (actionDetails 2)
>         type (actionDetails 3)
>         url (actionDetails 3)
>         pageTitle (actionDetails 3)
>         pageIdAction (actionDetails 3)
>         serverTimePretty (actionDetails 3)
>         pageId (actionDetails 3)
>         generationTime (actionDetails 3)
>         icon (actionDetails 3)
>         timestamp (actionDetails 3)
93,94c129,130
<         timeSpent (actionDetails 0)
<         timeSpentPretty (actionDetails 0)
---
>         timeSpent (actionDetails 3)
>         timeSpentPretty (actionDetails 3)
99,132c135,136
<         pluginsIcons
<         type (actionDetails 1)
<         url (actionDetails 1)
<         pageTitle (actionDetails 1)
<         pageIdAction (actionDetails 1)
<         serverTimePretty (actionDetails 1)
<         pageId (actionDetails 1)
<         generationTime (actionDetails 1)
<         icon (actionDetails 1)
<         timestamp (actionDetails 1)
<         timeSpent (actionDetails 1)
<         timeSpentPretty (actionDetails 1)
<         type (actionDetails 2)
<         url (actionDetails 2)
<         pageTitle (actionDetails 2)
<         pageIdAction (actionDetails 2)
<         serverTimePretty (actionDetails 2)
<         pageId (actionDetails 2)
<         generationTime (actionDetails 2)
<         timeSpent (actionDetails 2)
<         timeSpentPretty (actionDetails 2)
<         icon (actionDetails 2)
<         timestamp (actionDetails 2)
<         type (actionDetails 3)
<         url (actionDetails 3)
<         pageTitle (actionDetails 3)
<         pageIdAction (actionDetails 3)
<         serverTimePretty (actionDetails 3)
<         pageId (actionDetails 3)
<         generationTime (actionDetails 3)
<         timeSpent (actionDetails 3)
<         timeSpentPretty (actionDetails 3)
<         icon (actionDetails 3)
<         timestamp (actionDetails 3)
---
>         siteSearchKeyword (actionDetails 2)
>         siteSearchKeyword (actionDetails 3)
146d149
<         pageTitle (actionDetails 5)
149a153
>         siteSearchKeyword (actionDetails 5)
168d171
<         pageTitle (actionDetails 7)
171a175
>         siteSearchKeyword (actionDetails 7)
176a181,191
>         type (actionDetails 8)
>         url (actionDetails 8)
>         pageTitle (actionDetails 8)
>         pageIdAction (actionDetails 8)
>         serverTimePretty (actionDetails 8)
>         pageId (actionDetails 8)
>         generationTime (actionDetails 8)
>         timeSpent (actionDetails 8)
>         timeSpentPretty (actionDetails 8)
>         icon (actionDetails 8)
>         timestamp (actionDetails 8)
178a194,196
>         pageTitle (actionDetails 5)
>         siteSearchKeyword (actionDetails 1)
>     
Powered by GitHub Issue Mirror