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

Let users track Custom Dimensions #7

Closed
tsteur opened this issue Dec 2, 2015 · 4 comments
Closed

Let users track Custom Dimensions #7

tsteur opened this issue Dec 2, 2015 · 4 comments

Comments

@tsteur
Copy link
Member

tsteur commented Dec 2, 2015

In matomo-org/matomo#9129 we created a new plugin to track Custom Dimensions.

To the JavaScript Tracker we added a new method setCustomDimension(int dimensionId, string dimensionValue). This sets a tracking API parameter dimension$dimensionId=$dimensionValue. Eg dimension1=foo or dimension2=bar. So the tracking API parameter starts with dimension followed by the set dimensionId.

I reckon we should be consistent here with the PHP Tracker and clear all set custom dimensions after the next tracking request was sent.
eg

setCustomDimension(1, 'myvalue1')
setCustomDimension(2, 'myvalue2)
trackPageview()
// now dimension 1 and 2 would be cleared and one has to set values again

FYI: Custom Dimensions are similar to Custom Variables. Currently a plugin is needed to use them but in Piwik 3.0 it will be installed by default and at some point we will deprecate Custom Variables (not soon though)

@bcsorba
Copy link
Member

bcsorba commented Dec 3, 2015

My biggest concern with adding this functionality to the core API is the same one that you expressed here, namely that it goes against pattern to have functionality in the core API that is currently only available via a plugin.

It may be better currently to add the functionality for users to add custom tracking parameters to their requests, which appears to be the functionality in the js and php clients. This would allow users with the plugin to manually set the parameters, effectively allowing the functionality.

I think it may be a good idea however to explore the idea of a plugin framework for this tracker - this would allow all plugin creators to be able to extend the core tracker to their own needs.

I vote to add this functionality when dimensions are integrated into Piwik Core. Thoughts @tsteur, @mattab ?

@tsteur
Copy link
Member Author

tsteur commented Dec 3, 2015

I had the same concerns when I added it for PHP-Tracker and made it generic there see: https://github.com/piwik/piwik-php-tracker/pull/15/files

It's basically a method setCustomTrackingParameter(parameter, value) that let's you set a dimension like this: setCustomTrackingParameter('dimension1', 'my value')

@bcsorba
Copy link
Member

bcsorba commented Dec 4, 2015

We'll go with adding the custom tracking parameter then until this feature is integrated with core. See #8

@bcsorba bcsorba closed this as completed Dec 4, 2015
@tsteur
Copy link
Member Author

tsteur commented Dec 6, 2015

👍

tholu pushed a commit that referenced this issue Aug 1, 2022
…onents-httpasyncclient-4.1.5

Bump httpasyncclient from 4.1.4 to 4.1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants