Metric are values created by computing values in the log database tables and storing those values in the reporting database tables. You need to define reporting resources that hold these computed values.
Once you have determined the metrics you want to display in the ATG Campaign Optimizer Results tab, you can define properties/database columns that hold the relevant data. There are three pieces of data that must exist as reporting properties/columns:
The group ID associates the logging and reporting data together so it must be represented in both the logging and reporting data structures. The group ID is already defined in the reporting schema, so you only need to add this column if you are creating a new reporting table.
The
ABTestReportRepository
has an item descriptor calledtestReportGroup
that holds properties that require some simple mathematical computation, such as addition or subtraction. For example, number of users is represented as a property here. Be sure to add a property for your metric in thetestReportGroup
item descriptor and provide a corresponding database column.Each custom metric should append a property or several properties to an item descriptor in
ABTestReportRepository
. It’s a good idea to hold all data for a test group in one auxiliary database table for optimalReportGeneratorService
performance, but you can use multiple tables if that’s more convenient. The reporting database table must be accessible by themanagement
andreporting
modules.
You may find that your metric requires computations that use data from multiple metric handlers. Use the report property mapper to handle these computations and for others, such as those that calculate averages, that are quick to compute. The report property mapper calculates its values when a user requests to view the Results tab and discards these values afterwards. Although log data for such metrics is kept in the ABTestLogRepository
, the reporting data is not persistent and so it is not held in ABTestReportRepository.
See Extending the Report Property Mapper for information.
For example, if you want to see a total number of times test users view a Member Benefits page, you would define a property called MemeberBenefitsPageVisits
in ABTestReportRepository
testReportGroup
item descriptor and provide a similar column name to a database table that holds page visit information. Similarly, MemeberBenefitsLog
is added as a table to the logging database table and an item descriptor to ABTestLogRepository
. Each time a report is generated, a total count is calculated based on information in the log database.
MemberBenefitsPageVisits
holds a singular value, but you want to know how many times in total a page is viewed. You need to indicate that some value needs to be tallied. To do this, you set the metric handler generatedCountProperty
property to the property the property you added to the MemeberBenefitsPageVisits
property in the testReportGroup
item descriptor. The metric handler component also provides properties for adding property values together. See About MetricHandler for more information.