Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecommerce: Tracking multiple Product categories on an ecommerce page view does not work #2897

Closed
anonymous-matomo-user opened this issue Feb 1, 2012 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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 (#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.

@mattab
Copy link
Member

mattab commented Feb 8, 2012

(In [5777]) Fixes #2897

  • Forgot to stringify the array of categories. This wasn't covered in the tests since they use the php tracking api client.
  • Added JS tests

jeremy, it is very appreciated if you can test the new piwik.js and report if it's working for you too! thanks

@anonymous-matomo-user
Copy link
Author

I've tried the lastest version (1.7), but now the Ecommerce tracker seems not to work at all:

  • I can see the ecommerce custom variables values in the visitor log (in the bubble when we put the mouse on the url) : _pkp, _pks, _pkn, _pkc
  • I can also see them in the piwik_log_link_visit_action table, which means that they are saved
  • BUT NOW the "custom variables" page or even the "ecommerce and goals" page are empty

@mattab
Copy link
Member

mattab commented Feb 16, 2012

It's expected that they don't appear in the "Custom Variable" see #2755

However it's not expected that nothing works. On the demo we track ecommece and it is working (product name is tracked). What exactly is not working for you? can you put a screenshot? thx

@anonymous-matomo-user
Copy link
Author

OK I didn't see the #2755 ticket and so i thought that they will appear in the "custom variables" widget again.
Now I can see them in the ecommerce widgets so all is good!
I'm sorry for the unuseful last comment and for the waste of time ;)
However I can now confirm that tracking multiple categories is working like a charm.

@mattab
Copy link
Member

mattab commented Feb 16, 2012

So the conclusion is that "All" is working fine? :) that's good!!

@anonymous-matomo-user anonymous-matomo-user added this to the 1.7 Piwik 1.7 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants