Event tracking

To enable automatic event tracking for dynamic elements (e.g. when showing layers), they have to be marked.

To do this, pass the value "linkTrackInit" to the object "wts" as soon as new content is reloaded.

wts.push(["linkTrackInit"]);
// or
wts.push(["linkTrackInstall"]);
JS

Forms

Forms that are dynamically reloaded (e.g. in a layer) have to be marked for form tracking.

To do this, pass the value "formTrackInstall" to the object "wts" as soon as a new form is reloaded.

wts.push(["formTrackInstall"]);
// or
wts.push(["formTrackInit"]);
JS


In this example, the first form on the page is tracked using an existing form element called "wt_form". If the reloaded form is not marked in this way, you can also pass the form object directly.

wts.push(["formTrackInstall", document.getElementById('FORMULARID')]);
// or
wts.push(["formTrackInit", document.getElementById('FORMULARID')]);
JS


If you send your form via Ajax (which means the page is not left), you have to send the form request manually.

function myAjaxSubmit(formObject) {
	/* Your Code */
	wts.push(["formTrackSubmit", "true"]);
	wts.push(["send", "form"]);
	/* Your Code */
}
JS


Multiple forms

If you want to track on a single page multiple forms, use the method "multipleFormTrackInstall" or "multipleFormTrackInit" and pass the form as an HTML element.

wts.push(['multipleFormTrackInstall', document.forms[0]]);
wts.push(['multipleFormTrackInstall', document.forms[1]]);
wts.push(['multipleFormTrackInstall', document.forms[2]]);
JS


If you send your form via ajax or the user is not leaving the page after the form is sent, you have to send the form track request manually.
Use "multipleForm" or "multipleFormTrackSubmit" for this and pass the form as an HTML element.

function myAjaxSubmit(formObject) {
	/* Your Code */
	wts.push(['multipleFormTrackSubmit', formObject]);
	wts.push(['send', 'multipleForm', formObject]);
	/* Your Code */
}
JS


If all forms should be tracked together, don't pass a form to "multipleForm".

function myAjaxSubmit(formObject) {
	/* Your Code */
	wts.push(['multipleFormTrackSubmit', formObject]);
	wts.push(['send', 'multipleForm']);
	/* Your Code */
}
JS