public class CustomVariables
extends java.lang.Object
You can track up to 5 custom variables for each user to your app, and up to 5 custom variables for each screen view. You may configure Piwik to track more custom variables: http://piwik.org/faq/how-to/faq_17931/
Desired json output: { "1":["OS","iphone 5.0"], "2":["Piwik Mobile Version","1.6.2"], "3":["Locale","en::en"], "4":["Num Accounts","2"], "5":["Level","over9k"] }
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_LENGTH |
| Constructor and Description |
|---|
CustomVariables() |
CustomVariables(CustomVariables variables) |
CustomVariables(java.lang.String json) |
| Modifier and Type | Method and Description |
|---|---|
TrackMe |
injectVisitVariables(TrackMe trackMe)
Sets the custom variables with scope VISIT to a
TrackMe. |
CustomVariables |
put(int index,
java.lang.String name,
java.lang.String value)
Custom variable names and values are limited to 200 characters in length each.
|
CustomVariables |
put(java.lang.String index,
org.json.JSONArray values) |
CustomVariables |
putAll(CustomVariables customVariables) |
int |
size() |
java.lang.String |
toString() |
TrackMe |
toVisitVariables() |
protected static final int MAX_LENGTH
public CustomVariables()
public CustomVariables(@NonNull
CustomVariables variables)
public CustomVariables(@Nullable
java.lang.String json)
public CustomVariables putAll(CustomVariables customVariables)
public CustomVariables put(int index, java.lang.String name, java.lang.String value)
index - this Integer accepts values from 1 to 5.
A given custom variable name must always be stored in the same "index" per session.
For example, if you choose to store the variable name = "Gender" in index = 1
and you record another custom variable in index = 1, then the "Gender" variable
will be deleted and replaced with the new custom variable stored in index 1.
You may configure Piwik to track more custom variables than 5.
Read more: http://piwik.org/faq/how-to/faq_17931/name - of a specific Custom Variable such as "User type".value - of a specific Custom Variable such as "Customer".public CustomVariables put(java.lang.String index, org.json.JSONArray values)
index - index accepts values from 1 to 5.values - packed key/value pairpublic java.lang.String toString()
toString in class java.lang.Objectpublic int size()
public TrackMe injectVisitVariables(@NonNull TrackMe trackMe)
TrackMe.@NonNull public TrackMe toVisitVariables()