Article sections

    You can use simple Javascript events to connect your code to events emitted by our experiments. For example, you can subscribe to the omni:survey:inserted event that is triggered after an A/B type experiment has been inserted into your website.

    Events summary and example

    omni:goal:unbounce

    Called when a user interacts with the page and this way an un-bounce is registered. Read more about the bounce goal.

    _mktz.events.on(
        'omni:goal:unbounce',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('variation', data.variation);
            console.log('experiment', data.experiment);
        }
    );

    omni:goal:engagement

    Called when the engagement goal is triggered. Read more about the engagement goal.

    _mktz.events.on(
        'omni:goal:engagement',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('variation', data.variation);     
            console.log('experiment', data.experiment);
        }
    );

    omni:goal:sent

    Triggered when a goal is sent to the Omniconvert servers.

    _mktz.events.on(
        'omni:goal:sent',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('name', data.name);
            console.log('value', data.value);
            console.log('transaction', data.transaction);
        }
    );

    omni:variable:sent

    Triggered when an on-page variable is sent to the Omniconvert servers.

    _mktz.events.on(
        'omni:variable:sent',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('name', data.name);
            console.log('value', data.value);
        }
    );

    omni:slow:request

    Triggered when a slow request is detected.

    _mktz.events.on(
        'omni:slow:request',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('timeout', data.timeout);
            console.log('browser', data.browser);
        }
    );

    omni:experiments:finished

    Called when the initial run of onload experiments has finished.

    _mktz.events.on(
        'omni:experiments:finished',
        function (event) {
            var data = event.detail;
            console.log('all experiments that have run', data);
            console.log('equivalent to', _mktz.running_test);
        }
    );

    omni:ab:inserted

    Called when an A/B type experiment is inserted in your website.

    _mktz.events.on(
        'omni:ab:inserted',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('variation', data.variation);
            console.log('experiment', data.experiment);
            console.log('bucketed', data.bucketed);
        }
    );

    omni:interaction:inserted

    Called when an interaction/overlay is inserted into your website.

    _mktz.events.on(
        'omni:interaction:inserted',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('variation', data.variation);
            console.log('experiment', data.experiment);
        }
    );

    omni:interaction:lead-sent

    Triggered when a lead is sent to our servers.

    _mktz.events.on(
        'omni:interaction:lead-sent',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('experimentId', data.interaction.experimentId);
            console.log('variationId', data.interaction.lateVariation.variation_key);
            console.log('lead', data.lead);
            console.log('time', data.time);
        }
    );

    omni:survey:inserted

    Called when a survey is inserted into your website.

    _mktz.events.on(
        'omni:survey:inserted',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('survey', data.survey);
        }
    );

    omni:survey:question-next

    Triggered when the user advances to the next question in a survey.

    _mktz.events.on(
        'omni:survey:question-next',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('survey', data.survey);
        }
    );

    omni:survey:results-sent

    Called when a survey’s results are sent to our servers.

    _mktz.events.on(
        'omni:survey:results-sent',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('survey', data.survey);
            console.log('results', data.results);
        }
    );

    omni:survey:lead-sent

    Called when a survey’s lead collector form data is sent to the Omniconvert servers.

    _mktz.events.on(
        'omni:survey:lead-sent',
        function (event) {
            var data = event.detail;
            console.log('event', event.type);
            console.log('survey', data.survey);
            console.log('lead', data.lead);
            console.log('time', data.time);
        }
    );