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

Update Docs: Tracking Events with Custom Dimension #10389

Closed
rsirres opened this issue Aug 10, 2016 · 2 comments
Closed

Update Docs: Tracking Events with Custom Dimension #10389

rsirres opened this issue Aug 10, 2016 · 2 comments
Labels
c: Website matomo.org For issues related to our matomo.org website.
Milestone

Comments

@rsirres
Copy link

rsirres commented Aug 10, 2016

The JS Tracking API states the following: "To define a dimension value pass an object defining one or multiple properties as the last parameter".

However, when I try to track:
_paq.push(["trackEvent", "category", "action", "name", {dimension1: "fr"}]);
it considers the last parameter as "trackevent value" instead as "customData".

The problem is in the following method:
https://github.com/piwik/piwik/blob/023d80496bf3cc02a7f6141243e55e3fb262c647/js/piwik.js#L4615

We probably need to check the last parameter whether it is of type Object or simply a string/integer.

@tsteur
Copy link
Member

tsteur commented Aug 15, 2016

Please call it like this:

_paq.push(["trackEvent", "category", "action", "name", null, {dimension1: "fr"}]);

It is not meant as in we automatically use the last parameter sent to the method. It's meant as in the last parameter when all parameters are set. I will update the docs.

@tsteur tsteur closed this as completed Aug 15, 2016
@tsteur
Copy link
Member

tsteur commented Aug 15, 2016

@tsteur tsteur added c: Website matomo.org For issues related to our matomo.org website. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Aug 15, 2016
@tsteur tsteur added this to the 2.16.3 milestone Aug 15, 2016
@tsteur tsteur changed the title Tracking Events with Custom Dimension Update Docs: Tracking Events with Custom Dimension Aug 15, 2016
@mattab mattab removed the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Website matomo.org For issues related to our matomo.org website.
Projects
None yet
Development

No branches or pull requests

3 participants