To save data for your metric to the database, you need to create and configure components that collect the data for logging (data collection object), minimize the performance impediment caused by committing data to the database (queue), bundle data for an event (dataset), and map properties to database columns (mapper). Every metric requires a unique instance of the four components. Although this section describes how to create recording devices, you need not create the recorder itself because ATG Campaign Optimizer has already created it for you. Follow these steps:

  1. Create a data collection object by following the instructions in the Creating a New Data Collection Object section of the ATG Personalization Programming Guide.

    To view a data collection object (also called a logger) defined for an existing metric, navigate to /atg/abtest/logging/ContentViewedSQLLogger in the ACC Pages and Components > Components by Path task area.

  2. Create a queue by following the instructions in the Queues section of the ATG Platform Programming Guide. Be sure to set the datasetLogger property to your data collection object.

    To view a queue defined for an existing metric, navigate to /atg/abtest/logging/ContentViewedLoggerQueue in the ACC Pages and Components > Components by Path task area.

  3. Create a dataset in <ATG10dir>\home\localconfig\atg\registry\data\datasets by following the instructions in the Creating a New Dataset for a Custom Recorder section of the ATG Personalization Programming Guide. When deciding how many events to store, consider that a larger portion ensures a more representative sampling, but a smaller portion decreases the performance impact. In general, log all events for metrics that are summed values and a smaller amount for metrics that are average values. Factors that affect your decision include the frequency of logging, necessity of comprehensive data, and the length of time your test runs (fewer overall test participants increases the significance of each participant’s results).

    Note: The majority of metrics involve one dataset, but it may be necessary to create two if the table for a metric holds two groups of data as is the case in the ParticipantAssignedToTestGroup metric. The goal of this metric is to assign users into groups. Each dataset represents one group.

    To view the raw XML for a dataset that is defined for an existing metric, unjar <ATG10dir>\CampaignOptimizer10.1\ABTest\runtime\
    config\config.jar
    and navigate to atg\registry\data\datasets\contentviewed.xml.

  4. Create a mapper in <ATG10dir>\home\localconfig\atg\registry\data\mappers by following the instructions in the Creating the New Mapper section of the ATG Personalization Programming Guide. Also, see the Mapper XML Definition Language section in the same book for more information. Be sure to enclose the path to the queue in the <data-listener> tags.

    To view a mapper defined for an existing metric, unjar <ATG10dir>\CampaignOptimizer10.1\ABTest\runtime\config\
    config.jar
    and navigate to atg\registry\data\mappers\contentviewed.xml.