com.ibm.commerce.marketingcenter.events.databeans

Class ExperimentLoggingDataBean

  • java.lang.Object
    • com.ibm.commerce.marketingcenter.events.databeans.ExperimentLoggingDataBean


  • public class ExperimentLoggingDataBean
    extends java.lang.Object
    The experiment logging data to be passed in an Experiment Logging common base event and then persisted to the database. The following code samples demonstrate how to send an event to be persisted to the database in different situations:
    1. When an experiment is displayed to the customer:
          ExperimentLoggingDataBean eldb = new ExperimentLoggingDataBean(experimentId, testElementId, storeId);
          eldb.setExperimentData(experimentName, experimentTypeId);
          eldb.setTestElementData(testElementName, frequency, isControl);
          eldb.setResultData(results, resultType);
          eldb.setTestElementWasViewed(true);
          ExperimentEventUtilities.sendExperimentLoggingEvent(eldb);
       
    2. When an experiment result is clicked by the customer:
          ExperimentLoggingDataBean eldb = new ExperimentLoggingDataBean(experimentId, testElementId, storeId);
          eldb.setTestElementWasClicked(true);
          ExperimentEventUtilities.sendExperimentLoggingEvent(eldb);
       
    3. In a customization, for example, when the customer added a recommended product to their gift registry. The gift click action is associated with custom data field 1:
          ExperimentLoggingDataBean eldb = new ExperimentLoggingDataBean(experimentId, testElementId, storeId);
          eldb.setTestElementWasCustom1(true);
          ExperimentEventUtilities.sendExperimentLoggingEvent(eldb);
       
    • Constructor Summary

      Constructors 
      Constructor and Description
      ExperimentLoggingDataBean()
      Creates an ExperimentLoggingDataBean.
      ExperimentLoggingDataBean(java.lang.Integer experimentId, java.lang.Integer testElementId, java.lang.Integer storeId)
      Creates an ExperimentLoggingDataBean.
      ExperimentLoggingDataBean(java.lang.Integer experimentId, java.lang.Integer testElementId, java.lang.Integer storeId, java.lang.String sessionId)
      Creates an ExperimentLoggingDataBean.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getDisplayFrequency()
      This method gets the display frequency of the test element.
      java.lang.String getExperimentId()
      This method gets the experiment ID of the event being logged.
      java.lang.String getExperimentName()
      This method gets the name of the experiment of the event being logged.
      java.lang.String getExperimentSessionId()
      This method gets the session ID to be used in experiment events.
      java.lang.String getExperimentTypeId()
      This method gets the type of the experiment of the event being logged.
      boolean getIsControlTestElement()
      This method gets the value that specifies whether or not this test element is the control test element.
      java.lang.String getIsControlTestElementAsString()
      This method gets the value that specifies whether or not this test element is the control test element.
      java.lang.String getResults()
      This method gets the results that were displayed to the customer.
      java.lang.String getResultType()
      This method gets the type of the results that were displayed to the customer.
      java.lang.String getSessionId()
      This method gets the session ID of the event being logged.
      java.lang.String getStoreId()
      This method gets the store ID of the event being logged.
      java.lang.String getTestElementId()
      This method gets the test element ID of the event being logged.
      java.lang.String getTestElementName()
      This method gets the test element name of the event being logged.
      boolean getTestElementWasClicked()
      This method gets the value that specifies whether or not this test element was clicked by the customer.
      java.lang.String getTestElementWasClickedAsString()
      This method gets the value that specifies whether or not this test element was clicked by the customer.
      boolean getTestElementWasCustom1()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      java.lang.String getTestElementWasCustom1AsString()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      boolean getTestElementWasCustom2()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      java.lang.String getTestElementWasCustom2AsString()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      boolean getTestElementWasCustom3()
      Gets if an action was performed on the test element by the customer.
      java.lang.String getTestElementWasCustom3AsString()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      boolean getTestElementWasCustom4()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      java.lang.String getTestElementWasCustom4AsString()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      boolean getTestElementWasCustom5()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      java.lang.String getTestElementWasCustom5AsString()
      This method gets the value that specifies whether or not a custom action was performed on the test element by the customer.
      boolean getTestElementWasViewed()
      This method gets the value that specifies whether or not this test element was viewed by the customer.
      java.lang.String getTestElementWasViewedAsString()
      This method gets the value that specifies whether or not this test element was viewed by the customer.
      void setDisplayFrequency(java.lang.String freq)
      This method sets the display frequency of the test element.
      void setExperimentData(java.lang.String experimentName, java.lang.Integer experimentTypeId)
      This method sets the experiment data.
      void setExperimentId(java.lang.Integer expId)
      This method sets the experiment ID.
      void setExperimentName(java.lang.String name)
      This method sets the name of the experiment.
      void setExperimentTypeId(java.lang.Integer typeId)
      This method sets the type of the experiment.
      void setIsControlTestElement(boolean control)
      This method sets the field that indicates whether or not the test element is the control test element.
      void setIsControlTestElement(java.lang.String control)
      This method sets the field that indicates whether or not the test element is the control test element.
      void setResultData(java.lang.String results, java.lang.String resultType)
      This method sets the test result data.
      void setResults(java.lang.String results)
      This method sets the results that were displayed to the customer.
      void setResultType(java.lang.String restype)
      This method sets the type of the results that were displayed to the customer.
      void setSessionId(java.lang.String sessionId)
      This method sets the session ID.
      void setStoreId(java.lang.Integer storeId)
      This element sets the store ID.
      void setTestElementData(java.lang.String testElementName, java.lang.String frequency, boolean isControl)
      This method sets the test element data.
      void setTestElementData(java.lang.String testElementName, java.lang.String frequency, java.lang.String isControl)
      This method sets the test element data.
      void setTestElementId(java.lang.Integer testId)
      This method sets the test element ID.
      void setTestElementName(java.lang.String name)
      This method sets the test element name.
      void setTestElementWasClicked(boolean c)
      This method sets the field that specifies whether or not the test element was clicked by the customer.
      void setTestElementWasClicked(java.lang.String c)
      This method sets the field that specifies whether or not the test element was clicked by the customer.
      void setTestElementWasCustom1(boolean c)
      This method sets the field that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom1(java.lang.String c)
      This method sets the field that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom2(boolean c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom2(java.lang.String c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom3(boolean c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom3(java.lang.String c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom4(boolean c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom4(java.lang.String c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom5(boolean c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasCustom5(java.lang.String c)
      This method sets the value that specifies whether or not a custom action was performed on the test element by the customer.
      void setTestElementWasViewed(boolean v)
      This method sets the field that specifies whether or not the test element was viewed by the customer.
      void setTestElementWasViewed(java.lang.String v)
      This method sets the field that specifies whether or not the test element was viewed by the customer.
      java.lang.String toString()
      This method gets the string respresentation of this data bean.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExperimentLoggingDataBean

        public ExperimentLoggingDataBean()
        Creates an ExperimentLoggingDataBean. This constructor just calls the superclass constructor.
      • ExperimentLoggingDataBean

        public ExperimentLoggingDataBean(java.lang.Integer experimentId,
                                         java.lang.Integer testElementId,
                                         java.lang.Integer storeId)
        Creates an ExperimentLoggingDataBean. This constructor calls the superclass constructor then sets values specified by the three parameters.
        Parameters:
        experimentId - The experiment ID.
        testElementId - The test element ID.
        storeId - The store ID.
      • ExperimentLoggingDataBean

        public ExperimentLoggingDataBean(java.lang.Integer experimentId,
                                         java.lang.Integer testElementId,
                                         java.lang.Integer storeId,
                                         java.lang.String sessionId)
        Creates an ExperimentLoggingDataBean. This constructor calls the superclass constructor then sets values specified by the four parameters.
        Parameters:
        experimentId - The experiment ID.
        testElementId - The test element ID.
        storeId - The store ID.
        sessionId - The user's unique session ID.
    • Method Detail

      • getDisplayFrequency

        public java.lang.String getDisplayFrequency()
        This method gets the display frequency of the test element.
        Returns:
        The display frequency of the test element.
      • getExperimentId

        public java.lang.String getExperimentId()
        This method gets the experiment ID of the event being logged.
        Returns:
        The ID of the experiment.
      • getExperimentName

        public java.lang.String getExperimentName()
        This method gets the name of the experiment of the event being logged.
        Returns:
        The name of the experiment.
      • getExperimentSessionId

        public java.lang.String getExperimentSessionId()
        This method gets the session ID to be used in experiment events.
        Returns:
        sessionId The session ID.
      • getExperimentTypeId

        public java.lang.String getExperimentTypeId()
        This method gets the type of the experiment of the event being logged. This is a type from the EXPTYPE table.
        Returns:
        The experiment type ID.
      • getIsControlTestElement

        public boolean getIsControlTestElement()
        This method gets the value that specifies whether or not this test element is the control test element.
        Returns:
        True if the test element is the control test element, otherwise returns false.
      • getIsControlTestElementAsString

        public java.lang.String getIsControlTestElementAsString()
        This method gets the value that specifies whether or not this test element is the control test element.
        Returns:
        '1' if the test element is the control test element, otherwise returns '0'.
      • getResults

        public java.lang.String getResults()
        This method gets the results that were displayed to the customer.
        • For a product or item, results is a comma delimited list of CATENTRY_IDs.
        • For a category, results is a CATALOG_ID, followed by a comma delimited list of CATGROUP_IDs.
        • For a promotion, results is a comma delimited list of CALCODE_IDs.
        • For an ad, if the ad content is not known, then results is a comma delimited list of COLLATERAL_IDs.
        Returns:
        The results that were displayed to the customer.
      • getResultType

        public java.lang.String getResultType()
        This method gets the type of the results that were displayed to the customer.
        • For a product or item, resultType is P.
        • For a category, resultType is C.
        • For a promotion, resultType is D.
        • For an ad, if the ad content is known, then the resultType should be the correct content type of P,C, or D. If the ad content is not known, then resultType is A.
        Returns:
        The type of the results that were displayed to the customer.
      • getSessionId

        public java.lang.String getSessionId()
        This method gets the session ID of the event being logged.
        Returns:
        The session ID.
      • getStoreId

        public java.lang.String getStoreId()
        This method gets the store ID of the event being logged.
        Returns:
        The ID of the store.
      • getTestElementId

        public java.lang.String getTestElementId()
        This method gets the test element ID of the event being logged.
        Returns:
        The ID of the test element.
      • getTestElementName

        public java.lang.String getTestElementName()
        This method gets the test element name of the event being logged.
        Returns:
        The name of the test element.
      • getTestElementWasClicked

        public boolean getTestElementWasClicked()
        This method gets the value that specifies whether or not this test element was clicked by the customer.
        Returns:
        True if the test element was clicked by the customer, false otherwise.
      • getTestElementWasClickedAsString

        public java.lang.String getTestElementWasClickedAsString()
        This method gets the value that specifies whether or not this test element was clicked by the customer.
        Returns:
        '1' if the test element was clicked by the customer, '0' otherwise.
      • getTestElementWasCustom1

        public boolean getTestElementWasCustom1()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        True if a custom action was performed on the test element by the customer, otherwise returns false.
      • getTestElementWasCustom1AsString

        public java.lang.String getTestElementWasCustom1AsString()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        '1' if an action was performed on the test element by the customer; otherwise returns '0'.
      • getTestElementWasCustom2

        public boolean getTestElementWasCustom2()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        True if a custom action was performed on the test element by the customer, false otherwise.
      • getTestElementWasCustom2AsString

        public java.lang.String getTestElementWasCustom2AsString()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        '1' if a custom action was performed on the test element by the customer; otherwise returns '0'.
      • getTestElementWasCustom3

        public boolean getTestElementWasCustom3()
        Gets if an action was performed on the test element by the customer. Used for customization.
        Returns:
        true if an action was performed on the test element by the customer; otherwise returns false
      • getTestElementWasCustom3AsString

        public java.lang.String getTestElementWasCustom3AsString()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        True if a custom action was performed on the test element by the customer, false otherwise.
      • getTestElementWasCustom4

        public boolean getTestElementWasCustom4()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        True if a custom action was performed on the test element by the customer, false otherwise.
      • getTestElementWasCustom4AsString

        public java.lang.String getTestElementWasCustom4AsString()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        '1' if an action was performed on the test element by the customer; otherwise returns '0'.
      • getTestElementWasCustom5

        public boolean getTestElementWasCustom5()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        True if a custom action was performed on the test element by the customer, false otherwise.
      • getTestElementWasCustom5AsString

        public java.lang.String getTestElementWasCustom5AsString()
        This method gets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Returns:
        '1' if an action was performed on the test element by the customer; otherwise returns '0'.
      • getTestElementWasViewed

        public boolean getTestElementWasViewed()
        This method gets the value that specifies whether or not this test element was viewed by the customer.
        Returns:
        True if the test element was viewed by the customer, otherwise returns false.
      • getTestElementWasViewedAsString

        public java.lang.String getTestElementWasViewedAsString()
        This method gets the value that specifies whether or not this test element was viewed by the customer.
        Returns:
        '1' if the test element was viewed by the customer, otherwise returns '0'.
      • setDisplayFrequency

        public void setDisplayFrequency(java.lang.String freq)
        This method sets the display frequency of the test element.
        Parameters:
        freq - The display frequency of the test element.
      • setExperimentData

        public void setExperimentData(java.lang.String experimentName,
                                      java.lang.Integer experimentTypeId)
        This method sets the experiment data.
        Parameters:
        experimentName - The experiment name.
        experimentTypeId - The experiment type ID.
      • setExperimentId

        public void setExperimentId(java.lang.Integer expId)
        This method sets the experiment ID.
        Parameters:
        expId - The unique ID of the experiment.
      • setExperimentName

        public void setExperimentName(java.lang.String name)
        This method sets the name of the experiment.
        Parameters:
        name - The name of the experiment.
      • setExperimentTypeId

        public void setExperimentTypeId(java.lang.Integer typeId)
        This method sets the type of the experiment. This value is a type from the EXPTYPE table.
        Parameters:
        typeId - The experiment type ID.
      • setIsControlTestElement

        public void setIsControlTestElement(boolean control)
        This method sets the field that indicates whether or not the test element is the control test element. This method takes a boolean parameter. Set this field to true if the test element is the control test element, otherwise set the field to false.
        Parameters:
        control - True if the test element is the control test element, false otherwise.
      • setIsControlTestElement

        public void setIsControlTestElement(java.lang.String control)
        This method sets the field that indicates whether or not the test element is the control test element. This method takes a String parameter.
        Parameters:
        control - '1' if the test element is the control test element, '0' otherwise.
      • setResultData

        public void setResultData(java.lang.String results,
                                  java.lang.String resultType)
        This method sets the test result data.
        • For a product/item, resultType is P, results is a comma delimited list of CATENTRY_IDs
        • For a category, resultType is C, results is a CATALOG_ID, followed by a comma delimited list of CATGROUP_IDs
        • For a promotion, resultType is D, results is a comma delimited list of CALCODE_IDs
        • For an ad, if the ad content is known, then the result type should be the correct content type of P,C, or D. If the ad content is not known, then resultType is A, results is a comma delimited list of COLLATERAL_IDs
        Parameters:
        results - The result that was displayed to the customer.
        resultType - the type of data displayed to the customer.
      • setResults

        public void setResults(java.lang.String results)
        This method sets the results that were displayed to the customer.
        • For a product or item, results is a comma delimited list of CATENTRY_IDs.
        • For a category, results is a CATALOG_ID, followed by a comma delimited list of CATGROUP_IDs.
        • For a promotion, results is a comma delimited list of CALCODE_IDs.
        • For an ad, if the ad content is not known, then results is a comma delimited list of COLLATERAL_IDs.
        Parameters:
        results - The results that were displayed to the customer.
      • setResultType

        public void setResultType(java.lang.String restype)
        This method sets the type of the results that were displayed to the customer.
        • For a product/item, restype is P.
        • For a category, restype is C.
        • For a promotion, restype is D.
        • For an ad, if the ad content is known, then the resType should be the correct content type of P,C, or D. If the ad content is not known, then resType is A.
        Parameters:
        restype - The type of the results that were displayed to the customer.
      • setSessionId

        public void setSessionId(java.lang.String sessionId)
        This method sets the session ID.
        Parameters:
        sessionId - The session ID.
      • setStoreId

        public void setStoreId(java.lang.Integer storeId)
        This element sets the store ID.
        Parameters:
        storeId - The ID of the store.
      • setTestElementData

        public void setTestElementData(java.lang.String testElementName,
                                       java.lang.String frequency,
                                       boolean isControl)
        This method sets the test element data. The isControl parameter is of type boolean.
        Parameters:
        testElementName - The test element name.
        frequency - The display frequency of the test element.
        isControl - The test element the control element.
      • setTestElementData

        public void setTestElementData(java.lang.String testElementName,
                                       java.lang.String frequency,
                                       java.lang.String isControl)
        This method sets the test element data.
        Parameters:
        testElementName - The test element name.
        frequency - The display frequency of the test element.
        isControl - '1' if the test element is the control element, '0' otherwise.
      • setTestElementId

        public void setTestElementId(java.lang.Integer testId)
        This method sets the test element ID.
        Parameters:
        testId - The ID of the test element.
      • setTestElementName

        public void setTestElementName(java.lang.String name)
        This method sets the test element name.
        Parameters:
        name - The name of the test element.
      • setTestElementWasClicked

        public void setTestElementWasClicked(boolean c)
        This method sets the field that specifies whether or not the test element was clicked by the customer.
        Parameters:
        c - True if the test element was clicked by the customer, false otherwise.
      • setTestElementWasClicked

        public void setTestElementWasClicked(java.lang.String c)
        This method sets the field that specifies whether or not the test element was clicked by the customer.
        Parameters:
        c - '1' if the test element was clicked by the customer, '0' otherwise.
      • setTestElementWasCustom1

        public void setTestElementWasCustom1(boolean c)
        This method sets the field that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - True if a custom action was performed on the test element by the customer, false otherwise.
      • setTestElementWasCustom1

        public void setTestElementWasCustom1(java.lang.String c)
        This method sets the field that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - '1' if a custom action was performed on the test element by the customer, '0' otherwise.
      • setTestElementWasCustom2

        public void setTestElementWasCustom2(boolean c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - True if a custom action was performed on the test element by the customer, false otherwise.
      • setTestElementWasCustom2

        public void setTestElementWasCustom2(java.lang.String c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - '1'if a custom action was performed on the test element by the customer, '0' otherwise.
      • setTestElementWasCustom3

        public void setTestElementWasCustom3(boolean c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - True if a custom action was performed on the test element by the customer, false otherwise.
      • setTestElementWasCustom3

        public void setTestElementWasCustom3(java.lang.String c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - '1' if a custom action was performed on the test element by the customer, '0' otherwise.
      • setTestElementWasCustom4

        public void setTestElementWasCustom4(boolean c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - True if a custom action was performed on the test element by the customer, false otherwise.
      • setTestElementWasCustom4

        public void setTestElementWasCustom4(java.lang.String c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - '1' if a custom action was performed on the test element by the customer, '0' otherwise.
      • setTestElementWasCustom5

        public void setTestElementWasCustom5(boolean c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - True if a custom action was performed on the test element by the customer, false otherwise.
      • setTestElementWasCustom5

        public void setTestElementWasCustom5(java.lang.String c)
        This method sets the value that specifies whether or not a custom action was performed on the test element by the customer. Use this method for customization.
        Parameters:
        c - if an action was performed on the test element by the customer, '1' for true, '0' for false.
      • setTestElementWasViewed

        public void setTestElementWasViewed(boolean v)
        This method sets the field that specifies whether or not the test element was viewed by the customer.
        Parameters:
        v - True if the test element was viewed by the customer, false otherwise.
      • setTestElementWasViewed

        public void setTestElementWasViewed(java.lang.String v)
        This method sets the field that specifies whether or not the test element was viewed by the customer.
        Parameters:
        v - '1' if the test element was viewed by the customer, '0' otherwise.
      • toString

        public java.lang.String toString()
        This method gets the string respresentation of this data bean.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string respresentation of this data bean.