Hey Leute,
momentan stehe ich vor einem Problem bei der Erfassung von den Kategorien bei den Funktionen
piwikTracker.addEcommerceItem(); und piwikTracker.setEcommerceView();
Und zwar will ich mehrere Kategorien erfassen. Laut Beschreibung:
[quote="“Adventure Books”, // (optional) Product category. You can also specify an array of up to 5 categories eg. [“Books”, “New releases”, “Biography”]"]
[/quote]
Nun habe ich das auf diese Weise gemacht:
[quote="piwikTracker.setEcommerceView(false,false,[“Kategorie 1”,“Kategorie 2]);”]
[/quote]
Und dabei kommen dann diese Resultate in Piwik heraus:
[“Kategorie 1”,“Kategorie 2”]
oder
Array
Wie muss man das Array für mehrere Kategorien richtig an Piwik übergeben, damit es da keine Probleme gibt und die Daten richtig erfasst werden?
VIelen Dank und ein schönes Wochenende.
Jonas
Vielleicht ist das auch schon die Antwort auf das Problem… Bzw ein Bug ?
opened 05:58PM - 01 Feb 12 UTC
closed 10:16PM - 16 Feb 12 UTC
Bug
Piwik Version : 1.6
I've tried to use the e-commerce tracking as described in t… he documentation (http://piwik.org/docs/ecommerce-analytics/).
The documentation and that 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.