Why use custom metrics?
The main idea behind custom metrics in Adobe Target is to fire an mbox upon success of a specific goal and then use this mbox to track the metric in the experiment.
To do this you will need to use the trackEvent function provided by Adobe, the generic code is:
Where “mbox_name” is a name of your choice that describes the goal.
To provide some context and to illustrate how custom metrics can be used, let us consider the following insurance scenario with More Than.
Let’s say we want to run an experiment on the More Than “Public Liability” page, and as well as tracking the main CTA “Start your quote” we also want to track clicks on the “Find out more about your policy” CTA – circled in red on the screenshot below.
The code to track clicks on the “Find out more” CTA is:
It is selecting the CTA and attaching a click event listener which fires the mbox we named “Clicked_find_out_more_cta”.
If your experiment has a control and a variation or multiple variations and you want to track the same goal in all of these, you will need to add the code on each variation.
Adding the metric to your experiment
In order to track this new custom mbox you need to add it as a metric on our experiment, this can be done under the “Goals & Settings” section.
Under “Goal Metric” select “Conversion”- “Viewed an mbox”- copy and paste the name of the mbox, in this case, “Clicked_find_out_more_cta”.
QA custom metric
To check the metric is firing correctly,
1) Use the preview link to enter/open the experience
2) Open the developer tool (right click on the page & click “inspect”), select the “Network” tab
3) In the filter textbox type “mbox” –
4) Click on the “Find out more about your policy” CTA
5) You should see the mbox firing on the network tab
Custom metrics allow you to be more creative with your analysis of experiments. As shown in this brief article they are relatively straightforward to setup, so start getting more granular with your analysis in Adobe Target!