Article sections

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

    Create the Custom Goal

    1. Go to the main left menu and select the ‘Advanced’ option, then ‘Goals’ and press the ‘New goal’ button:

    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 piece of 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:

    Add the goal into an A/B test

    omniconvert add goal 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. Here, you can select the goal created previously. In our case, the ‘bannerclicks’ goal:

    omniconvert select goal

    Integrate the custom goal code snippet into the object you want to track

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

    2. Click on the banner you want to track the clicks for and use ‘Edit element’ > ‘HTML code’:

    omniconvert edit element html

    3. Add a small change to the script like a letter to the title or something and save the 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:

    6. Save the changes and publish the experiment.

    7. 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. 

    Was this post helpful?