Class GAUriBuilder

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.newsletter.ga.GAUriBuilder
All Implemented Interfaces:
Component, LogEnabled

public class GAUriBuilder extends AbstractLogEnabled implements Component
Component which helps building google analytics event URIs.
  • Field Details

  • Constructor Details

  • Method Details

    • getEventGifUri

      public String getEventGifUri(String gaWebId, String category, String action, String label)
      Get an event GIF URI.
      Parameters:
      gaWebId - the GA web ID.
      category - the event category.
      action - the event action.
      label - the event label.
      Returns:
      the event GIF URI.
    • getEventGifUri

      public String getEventGifUri(String gaWebId, String category, String action, String label, int value)
      Get an event GIF URI.
      Parameters:
      gaWebId - the GA web ID.
      category - the event category.
      action - the event action.
      label - the event label.
      value - the event value.
      Returns:
      the event GIF URI.
    • getEventGifUri

      public String getEventGifUri(String gaWebId, String category, String action, String label, int value, boolean nonInteraction)
      Get an event GIF URI.
      Parameters:
      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.
      Returns:
      the event GIF URI.
    • getEventGifUri

      public String getEventGifUri(String gaWebId, String eventIdentifier)
      Get an event GIF URI.
      Parameters:
      gaWebId - the GA web ID.
      eventIdentifier - the event identifier.
      Returns:
      the event GIF URI.
    • getEventGifUri

      public String getEventGifUri(String gaWebId, String eventIdentifier, boolean usePlaceholderTokens)
      Get an event GIF URI.
      Parameters:
      gaWebId - the GA web ID.
      eventIdentifier - the event identifier.
      usePlaceholderTokens - True to use tokens instead of randomly generated values
      Returns:
      the event GIF URI.
    • getEventIdentifier

      public String getEventIdentifier(String category, String action, String label) throws URISyntaxException
      Compute an event identifier.
      Parameters:
      category - the event category.
      action - the event action.
      label - the event label.
      Returns:
      the event GIF URI.
      Throws:
      URISyntaxException - if an error occurs encoding the event identifier.
    • getEventIdentifier

      public String getEventIdentifier(String category, String action, String label, int value) throws URISyntaxException
      Compute an event identifier.
      Parameters:
      category - the event category.
      action - the event action.
      label - the event label.
      value - the event value.
      Returns:
      the event GIF URI.
      Throws:
      URISyntaxException - if an error occurs encoding the event identifier.
    • getEventIdentifier

      public String getEventIdentifier(String category, String action, String label, int value, boolean nonInteraction) throws URISyntaxException
      Compute an event identifier.
      Parameters:
      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.
      Returns:
      the event GIF URI.
      Throws:
      URISyntaxException - if an error occurs encoding the event identifier.
    • encodeValue

      Encode a value to use as an identifier component.
      Parameters:
      value - the value to encode.
      Returns:
      the encoded value.
      Throws:
      URISyntaxException - if an error occurs encoding the value.