-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Custom Variables support: new JS API and new reports #1984
Comments
If I understand correctly, this busts the existing setCustomData() by moving the key-value storage into piwik.js. What is "index"? Is that a namespace? (e.g., corresponds to the Plugin's name?) Shouldn't it also be present in getCustomData()? I suggest we keep the existing json_encode() rather than splitting up into separate parameters. |
I think there are a variety of scope for custom data:
|
Having several scopes would be a feature request, for now this proposal is implementing the 'session' scope (similar to GA session scope) |
The current implementation provides the first two scopes. |
Replying to vipsoft:
It provides 'potential' page level scope, if the custom data was recorded (which is not the case at this stage). However this ticket will actually implement it for the session level (ie. update schema, new report & API). I think we agree :) See interesting article at http://www.roirevolution.com/blog/2010/12/ecommerce-with-custom-variables.php |
(In [3780]) Refs #1984 - New plugins CustomVariables
Code style
|
To finish the ticket, this is pending first party cookie implementation JS API updates required for the following:
|
In setCustomVariables, what's the difference between nameId and name? Assuming nameId, name, or value can contain '.', it looks like a change in the #409 requirements (i.e., store an associative array in the cookie). |
basically, nameId and name must always match, so that we always record the custom variable name,value in the same 'slot' in the database. This is similar to GA implentation. nameId is integer, |
At the moment, the cookie storage isn't abstracted because in #409, we are only storing simple values (dot-separated, in the case of _pk_id). |
(In [3783]) refs #409 - first party cookies
refs #739 - piwik.js improvements
refs #752 - track middle mouse button clicks (via mousedown+mouseup pseudo-click handler); defaults to tracking true "clicks"
refs #1984 - custom variables vs custom data @todo These are just stubs.
|
(In [3787]) Refs #1984
Still to do:
|
(In [3790]) refs #1984
|
(In [3882]) Refs #1984
|
(In [3883]) Refs #1984 - Deleting custom variables feature, adding doc in piwik.org |
I would have appreciated a heads-up before [3882]. setCustomVariable() doesn't implement request/page scope; deprecating customData wasn't discussed and doing so, breaks the unit tests in tests/javascript/index.php. |
(In [3917]) Refs #1984 - Displaying custom variables |
(In [3939]) refs #409:
refs #1984:
refs #2078 Webkit bug ("Failed to load resource") when link target is the current window/tab
|
Follow up issue #2206 because of setCustomData() do not exists anymore. |
Documentation needs update because of
|
Documentation also needs update for:
|
I mean "opt_scope" need to be documented. |
Thanks hass. Deprecating setCustomData() was a bit premature. setCustomData() is still needed for unit tests, so it still exists in piwik.js. Also, setCustomVariable() doesn't implement opt_scope yet. |
Ok, but setCustomData() need to be kept - not only for unit tests, please. I have integrated setCustomVariables in the Piwik for Drupal module, but still have some questions.
|
name and value are limited to 100 chars each use setRequestMethod('POST') to workaround GET limits scope of custom variable is equivalent to GA "session" scope (visit) |
I updated the Custom Variables documentation with the following
|
Sorry for being nitpicking, but 100 chars after URL encoding or before? THX |
100 chars limit before URL encoding. But in any case please don't push the limit, we highly recommend to use values as small as possible |
how to show my sql table in piwik dashboard..which file i have to edit? |
Can anyone provide a example for custom variables such as-- getting a username or email as custom variable on form submit |
FEATURE RELEASED in Piwik 1.2
See the documentation in: Web analytics - Tracking Custom Variables
The goal of this feature is to put visits into buckets (segments) via the Piwik JS API. Then access reports about these custom name/values just like other reports in Piwik.
Custom data: Use cases
Custom data: New default reports
This new report could be displayed in "Visitors > Custom Variables"
Custom data: JS API piwik.js
We should allow for up to 3 custom variables (GA does 5 but 3 will be fine!).
This up to 3 (key,value) pairs will be stored in 1st party cookie.
For a given index, name should always be the same.
Scope of cookie is session scope (dies when browser dies).
The content of the cookie is passed to piwik.php (c1n=custom_name_1&c1v=custom_value_1 etc.?).
The name,value pairs should be limited in length to not excell the URL limit (they are send on each page view along with current URL, page name and possibly url ref and more).
Setting a custom var with the same slot in a subsequent page view will overwrite previous value set.
Also update PHP Tracker API with these new methods.
Custom data: Schema update
Add 6 fields to the log_visit table: custom_name_1, custom_value_1, custom_name_2, custom_value_2, etc.
name and value are the parameters to JS function piwik.setCustomVar(1, name, value)
Custom data: Tracker update
New visitor and existing visitor will set the custom variable if passed.
Custom data: Archiving
The new reports (see above) require couple new queries.
Custom data: API
New API function released to report the custom data names and values, similar to existing functions.
Performance impact
When no custom var is set, this should not affect the speed (ie. no performance regression in normal use case). Check this is the case.
For each custom variable, distinct values should be kept low whenever possible (eg. 10 or 20 disctinct values).
Nice to have
Please submit any feedback/question.
The text was updated successfully, but these errors were encountered: