If you want to track clicks on a button that has been set to trigger a Survey or  Interaction on a page included in an A/B test, you need to follow these steps:

A. Create the Custom Goal

1. Into the Dashboard, go to the Goals tab and select New goal:

2. Give a representative name to the goal and select “Custom” from the goal options. In our case we named it “bannerclicks”:

3. Hit Save and a custom code will be generated. This code should be copied in order to be used further in the process.

The custom goal is now created and can be reviewed in the Dashboard under the Goals section:


B. Add the goal into an A/B test

Add the goal to the A/B test experiment from the tab – “Traffic Allocation and Goals”:

Once you click on “Select or create a goal”, a new window will appear from which you can select the the goal created previously. In our case “bannerclicks” goal.

C. Integrate the custom goal code snippet into the object you desire to track

1. Go to the Variations tab, select the variation.

2. Click on the banner you wish to track the clicks for and edit it as HTML.

3. Add a small change to the script like a letter to the title or something and save the change.

Make a change

4. Scroll over the variation name and click on “Code” option. You will see all the changes you’ve made so far, including the one with the letter added in the title.


5. Select the part that comes after the   ).  and change it with this one :

.click(function (event) {
(new _mktzInteract()).track_click_safely(event, mktz_$(this)); 
Don’t forget to change the name in the code above from “bannerclicks” into the one you’ve added yourself.


Like we did in this picture:


  1. Save the changes and publish the experiment.
  2. Test it to see if the goal tracking setup is working.
Attention: This setup will apply an on click goal tracking only for the Variation of the experiment. It will not track clicks for Control.