* remove illegal characters from label

This commit is contained in:
Reinhard Pointner 2011-10-15 12:40:35 +00:00
parent 5b917ef1d0
commit 22dd7abc8d
1 changed files with 10 additions and 1 deletions

View File

@ -63,7 +63,16 @@ public class Analytics {
if (!tracker.isEnabled())
return;
tracker.trackEvent(category, action, label, value);
tracker.trackEvent(normalize(category), normalize(action), normalize(label), value);
}
private static String normalize(String label) {
if (label == null)
return null;
// trim braces
return label.replaceAll("[*()]", "").trim();
}