Skip to main content

Triggering Call-to-Action tracking

To be able to use the trigger() method, you must first set up a Call-to-Action tracking in Mediahawk. Once set up, it can then be triggerered with the desired data.

tip

Triggering a count only requires the dimensionIndex to be passed with the call.

tip

Triggering a sum requires both the dimensionIndex, as well as the JavaScript object holding the value property.

Triggering a count:

mhct.trigger('dm1');

Triggering a sum with a variable:

var price = document.getElementById('item_price');
mhct.trigger('dm2', {'value': price, 'text': 'Purchase value.'});

Triggering a count on form submit:

$("#productForm").submit(function(){
mhct.trigger('dm3', {'text': 'Form submitted by user.'});
});