---
# System prepended metadata

title: '**Hans Anders AB test tracking instructions**'

---

# **Hans Anders AB test tracking instructions**

In order to analyze the AB test we need to have tracking in place to see what visitors are doing in both the control and the experiment. We want to see whether we can steer people to choose the recommended timeslot with the new design. In order to track this we need to be able to answer the following questions:
* Was the visitor in the control or experiment group?
* In the experiment group: is the visitor interacting with a recommended timeslot?
* In the experiment group: is the visitor eventually booking a recommended timeslot?
* In the control group: which timeslot is the visitor interacting with?
* In the control group: which timeslot is the visitor eventually booking?

With this data we should be able to measure whether the experiment is making visitors book a recommended timeslot and if that is an increase for these timeslots compared to the control group.

![](https://i.imgur.com/9kcxDXG.png)

**3.Viewed store block**
When a store block is displayed/opened the information in the dataLayer has to be filled like this with event push storeBlockView:
``` javascript
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
	'event': 'storeBlockView',
	'data': {
    	'eventCategory': 'User interaction',
    	'eventAction': 'Viewed store block',
	    'funnelName': 'Make appointment',
    	'funnelStep': 'Store and time selection',
        'funnelOrigin': 'xxxxxx',              //identification of how the user started the flow/ previous page path
    	'appointmentType': 'Eye test',          // possible values: Eye test; Pick up glasses; Service and repair; Eye test & Purchase new glasses; Consultation
        'storeBlockDaysToFirstAvailibility': 0,
    	'storeBlockDistance': 1900,
        'storeBlockName': 'Hans Anders Amsterdam'
        'testSegment': 'experiment'           //possible values: control; experiment;
        'timeSlotType': 'recommended'    //possible values: recommended; not-recommended;
        'timeSlotPosition': 1,        //position of timeslot (e.g, 1, 2, 3 etc.) This is so we can see which one people choose in the control segment
        'timeSlotTotal': 12,        //total number of available timeSlots for the selected store and day. This is so we can compare stores and days that are eligible for the test.
	}
});
```
**5.Success**
When the user successfully submits the appointment: 

``` javascript
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
   'event' : 'generate_lead',
     'data': {
     'eventCategory': 'User interaction',
     'eventAction': 'Make appointment - Success',
     'funnelName': 'Make appointment',
     'funnelStep': 'Success',
     'funnelOrigin': 'xxxxxx',              //identification of how the user started the flow/ previous page path
     'appointmentType': 'Eye test',          // possible values: Eye test; Pick up glasses; Service and repair; Eye test & Purchase new glasses; Consultation
     'appointmentID': "<Id of the appointment>'
     'testSegment': 'control'           //possible values: control; experiment;
     'timeSlotType': 'not-recommended'    //possible values: recommended; not-recommended;
     'timeSlotPosition': 5,        //position of timeslot (e.g, 1, 2, 3 etc.) This is so we can see which one people choose in the control segment
     'timeSlotTotal': 14,        //total number of available timeSlots for the selected store and day. This is so we can compare stores and days that are eligible for the test.
	}
});
```
}
});               
    
</script>
```