public class GAUriBuilder extends AbstractLogEnabled implements Component
| Modifier and Type | Field and Description | 
|---|---|
private static Random | 
_RNG  | 
static String | 
DOMAIN_HASH
The domain hash. 
 | 
static String | 
GA_GIF_URL
The analytics GIF URL. 
 | 
static String | 
GA_UTMHID_TOKEN
Token to replace in the url by a random UTMHID value 
 | 
static String | 
GA_UTMN_TOKEN
Token to replace in the url by a random UTMN value 
 | 
static String | 
GA_VERSION
The analytics API version. 
 | 
static String | 
GA_VISITORID_TOKEN
Token to replace in the url by a random VisitorID value 
 | 
static String | 
ROLE
The avalon component role. 
 | 
| Constructor and Description | 
|---|
GAUriBuilder()  | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
encodeValue(String value)
Encode a value to use as an identifier component. 
 | 
String | 
getEventGifUri(String gaWebId,
              String eventIdentifier)
Get an event GIF URI. 
 | 
String | 
getEventGifUri(String gaWebId,
              String eventIdentifier,
              boolean usePlaceholderTokens)
Get an event GIF URI. 
 | 
String | 
getEventGifUri(String gaWebId,
              String category,
              String action,
              String label)
Get an event GIF URI. 
 | 
String | 
getEventGifUri(String gaWebId,
              String category,
              String action,
              String label,
              int value)
Get an event GIF URI. 
 | 
String | 
getEventGifUri(String gaWebId,
              String category,
              String action,
              String label,
              int value,
              boolean nonInteraction)
Get an event GIF URI. 
 | 
String | 
getEventIdentifier(String category,
                  String action,
                  String label)
Compute an event identifier. 
 | 
String | 
getEventIdentifier(String category,
                  String action,
                  String label,
                  int value)
Compute an event identifier. 
 | 
String | 
getEventIdentifier(String category,
                  String action,
                  String label,
                  int value,
                  boolean nonInteraction)
Compute an event identifier. 
 | 
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic static final String GA_GIF_URL
public static final String GA_VERSION
public static final String DOMAIN_HASH
public static final String GA_VISITORID_TOKEN
public static final String GA_UTMN_TOKEN
public static final String GA_UTMHID_TOKEN
public GAUriBuilder()
public String getEventGifUri(String gaWebId, String category, String action, String label)
gaWebId - the GA web ID.category - the event category.action - the event action.label - the event label.public String getEventGifUri(String gaWebId, String category, String action, String label, int value)
gaWebId - the GA web ID.category - the event category.action - the event action.label - the event label.value - the event value.public String getEventGifUri(String gaWebId, String category, String action, String label, int value, boolean nonInteraction)
gaWebId - the GA web ID.category - the event category.action - the event action.label - the event label.value - the event value.nonInteraction - true if the event does not trigger an interaction.public String getEventGifUri(String gaWebId, String eventIdentifier)
gaWebId - the GA web ID.eventIdentifier - the event identifier.public String getEventGifUri(String gaWebId, String eventIdentifier, boolean usePlaceholderTokens)
gaWebId - the GA web ID.eventIdentifier - the event identifier.usePlaceholderTokens - True to use tokens instead of randomly generated valuespublic String getEventIdentifier(String category, String action, String label) throws URISyntaxException
category - the event category.action - the event action.label - the event label.URISyntaxException - if an error occurs encoding the event identifier.public String getEventIdentifier(String category, String action, String label, int value) throws URISyntaxException
category - the event category.action - the event action.label - the event label.value - the event value.URISyntaxException - if an error occurs encoding the event identifier.public String getEventIdentifier(String category, String action, String label, int value, boolean nonInteraction) throws URISyntaxException
category - the event category.action - the event action.label - the event label.value - the event value.nonInteraction - true if the event does not trigger an interaction.URISyntaxException - if an error occurs encoding the event identifier.public String encodeValue(String value) throws URISyntaxException
value - the value to encode.URISyntaxException - if an error occurs encoding the value.