Each event used in a test relies on a metric handler component to describe how the information generated by the event is logged and compiled into reports. Because each event is unique, it has unique reporting and logging requirements so there’s one metric handler component per event. Keep in mind that one metric handler can represent multiple metrics, in fact all metrics that derive values from a given event should use the same metric handler.

ATG Campaign Optimizer comes with several metric handler components by default. For a listing, see Configuring Data Logging. If your metric uses an event that already has a metric handler, configure that metric handler for your metric. Otherwise, create a new metric handler component and configure it accordingly:

About MetricHandler

The base class, atg.abtest.metrics.MetricHandler, determines the data that should be logged for a given event. By default, it supports the tracking of data that is common to all tests, such as when a test starts and ends as well as when new or transient users are assigned to a group.

ATG Campaign Optimizer comes with MetricHandler components, each of which facilitates reporting for a different event type. When you create tests that use events supported by default, ATG Campaign Optimizer automatically uses the appropriate metric handler component and configures it accordingly. For more information about MetricHandler components, see Configuring Data Logging.

Use MetricHandler when your metric when the event it uses isn’t limited by a condition. Configure an instance of MetricHandler with information that’s tailored to your event. Here’s a quick summary of properties by subject matter:

Note that this isn’t a complete list of properties supplied by MetricHandler, but rather a listing of properties for which you are encouraged to supply values:

Property

Description

currencySumProperties

A map made up of the following:

- A key set to a currency property that needs to be added up. This property you specify here is defined in the logDataItemDescriptorName item descriptor of the ABTestLogRepository.

- A value set to the ABTestReportRepository property that holds, for the property specified in the key, the total amount gathered for all users in a test group.

When you specify a value for this property, you need to provide values to logCurrencyCodePropertyName, reportCurrencyCodePropertyName, and targetCurrency.

datasetPath

The path to the dataset used to log the particular event. (Required)

datasetPropertyName

The property in ABTestLogRepository that identifies the datasets used by the item descriptor in the logDataItemDescriptorName property. You need to provide a value to this property only if you specify generatedCountProperty or uniqueCountGeneratedProperty.

doubleSumProperties

A map made up of the following:

- A key set to a property of type double that needs to be added up. This property you specify here is defined in the logDataItemDescriptorName item descriptor of the ABTestLogRepository.

- A value set to the ABTestReportRepository property that holds, for the property specified in the key, the total for all users in a test group.

eventJMSType

The type of JMS event to be logged. (Required)

generatedCountProperty

The property defined in the testReportGroup item descriptor that will hold the total number of events of this type logged for one test group.

When you provide a value to this property, you need to supply a value to datasetPropertyName as well. If you use two datasets and you want to subtract the results from one dataset, add the name of the dataset you want to subtract to the subtractionDatasetPath property.

integerSumProperties

A map made up of the following:

- A key set to a property of type integer that needs to be added up. This property you specify here is defined in the logDataItemDescriptorName item descriptor of the ABTestLogRepository.

- A value set to the ABTestReportRepository property that holds, for the property specified in the key, the total for all users in a test group.

logCurrencyCodePropertyName

The property in the ABTestLogRepository that holds the ISO 4217 currency code for all currency values in this logged entry.

logDataItemDescriptorName

The item descriptor for the log that holds data about this event. (Required)

recordEventAction

The scenario action to use to record the event. Omitting a value to this property causes the default, recordABTestEvent, to be used.

renderLoggingAction

A Boolean property that determines if a logging action will be included in test scenarios. Omitting a value to this property causes the default, true, to be used. See Turning off Logging for more details.

reportCurrencyCodePropertyName

The property in the ABTestReportRepository that holds the ISO 4217 currency code used for all currency values in the report. The reportCurrencyCodePropertyName has the same value as MetricHandler.targetCurrency.

segmentNameResourceBundle

The resource bundle that specifies a segment name used in scenarios that record this event. (Required)

segmentNameResourceKey

The resource bundle segmentNameResourceKey key that identifies the segment name that acts as a label for scenario segments that record this event. (Required)

subtractionDatasetPath

The property in the ABTestLogRepository that identifies a dataset with log entries that should be subtracted from the total set (identified in the datasetPath property). Set this property only when you set generatedCountProperty.

targetCurrency

The ISO 4217 currency code used for all report monetary values computed by this metric handler.

uniqueCountGeneratedProperty

The property in the ABTestReportRepository that holds the tally generated for the uniqueCountLogProperty value.

When you provide a value to this property, you need to supply values to datasetPropertyName and uniqueCountLogProperty.

uniqueCountLogProperty

A property in the ABTestLogRepository for which ATG Campaign Optimizer will tally the total number of unique values. Use this property when you want a total count that doesn’t involve all rows in the database. For example, to determine how many times a user visited a page per session, you’d set this property to session ID.

About EventConditionMetricHandler

The atg.abtest.metrics.EventConditionMetricHandler class extends the MetricHandler class to allow you to define scenario conditions for your event. For example, rather than tracking the total number of purchased orders with MetricHander, you can use EventConditionMetricHandler to monitor how often users register for a certain kind of membership, such as free or paid. The EventConditionMetricHandler class generates test scenarios that log data only when an event satisfies a condition you define.

To collect data for the event using EventConditionMetricHandler, create a component of this class in the ACC and provide values to the base MetricHandler properties as well as to the following EventConditionMetricHandler-specific properties:

Property

Description

eventPropertyName

A property for the event. Although an event may have several properties available, EventConditionMetricHandler can handle one condition per event. For example, the ProfileUpdate event contains old profile values and new profile values, among other properties. This means you could define your metric handler to log an event if a profile contains a certain value or is changed to include a specific new one. (Required)

To locate the property name for standard ATG events, see the section for your event in the Using Scenario Events chapter of the ATG Personalization Programming Guide.

For commerce events, see Appendix C: ATG Commerce Messages of the ATG Commerce Programming Guide.

constantType

Data type for the value in constantValue. When no value is provided to this property, the default, java.lang.String, is used.

constantValue

The value that is compared to the property indicated in the eventPropetyName. (Required if the operator specified in filterOperator is binary.)

filterOperator

The operator used to evaluate the event property value. (Required)

Options include the following: isNull, isNotNull, isTrue, isFalse, eq (equals), ne (not equals), lt (less than), le (less than or equal to), gt (greater than), ge (greater than or equal to), contains, notContains, containsIgnoreCase, startsWith, notStartsWith, startsWithIgnoreCase, notStartsWithIgnoreCase, endsWith, notEndsWith, endsWithIgnoreCase, notEndsWithIgnoreCase, includes, and notIncludes.

The operator is considered to be unary if it appears in the list defined in unaryOperators. If you specify a unary operator, you shouldn’t specify a constantValue or constantType.

unaryOperators

An array of single operand operator strings used to evaluate the constantValue. Options include: isNull, isNotNull, isTrue, and isFalse.

Set this property unless the condition you want to use is a custom, unary condition. In this case, override the default values in this property by setting it to your custom condition. This means that filterOperator and unaryOperators will have the same value.

About ConditionalFormSubmissionMetricHandler

The atg.abtest.metrics.ConditionalFormSubmissionMetricHandler class extends EventConditionMetricHandler to provide a preconfigured class for FormSubmission events. You should use this class to configure logging and reporting when you want a test to record when a specific form page is submitted.

Note: Pages that include the form need to be configured to generate events. See the Form Submission Event section of the ATG Personalization Programming Guide for instructions.

When you use this class, create a component and define values for the relevant properties as described in About MetricHandler. The only property provided by ContidionalFormSubmissionMetricHandler that you need to set is constantValue. Set constantValue to the form name for which information will be logged when it is submitted.

The following properties are provided with these default values:

Property

Default Value

eventJMSType

atg.das.FormSubmission

eventPropertyName

formName

filterConstruct

event-property-filter

filterOperator

eq

About ConditionalPageVisitMetricHandler

The atg.abtest.metrics.ConditionalPageVisitMetricHandler class extends EventConditionMetricHandler to support PageVisit events that use a condition. You should use this class when you want visits to a particular page to be tracked (the particular page being the condition). ATG Campaign Optimizer includes a MetricHandler component called PageVisitMetricHandler that supports PageVisit events without conditions: it tracks the total number of pages viewed by test participants.

When you use this class, create a component and define values for the relevant properties as described in About MetricHandler. The only property provided by ContidionalPageVisitMetricHandler that you need to set is constantValue. Set constantValue to the form name for which information will be logged when it is submitted.

The following properties are provided with these default values:

Property

Default Value

eventJMSType

Atg.dps.PageVisit

eventPropertyName

scenarioPathInfo

filterOperator

Eq