Ticket #2897 (closed Bug: fixed)
Ecommerce: Tracking multiple Product categories on an ecommerce page view does not work
| Reported by: | jeremy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.7 Piwik 1.7 |
| Component: | Core | Keywords: | |
| Cc: | Sensitive: | no |
Description
Piwik Version : 1.6
I've tried to use the e-commerce tracking as described in the documentation (http://piwik.org/docs/ecommerce-analytics/).
The documentation and that ticket ( http://dev.piwik.org/trac/ticket/2659) tell us that we can assign multiple categories to products, but it seems that it actually doesn't work via the piwikTracker.setEcommerceView function (JS tracker). For example :
piwikTracker.setEcommerceView('mysku','myname',["category1","category2","category3"],'54.50');
It results in an empty Product Category "Custom Variable value not defined".
I've activated the debug mode and i've found a first error :
Warning: substr() expects parameter 1 to be string, array given in /www/piwik/core/Tracker/Visit.php on line 1082
The error appears in the getCustomVariables and truncateCustomVariable functions.
It seems that the code is not handling arrays and assume that all custom variables are only strings.
