Consent
Sometimes there are situations where you don't want to track a user until they have agreed to be tracked. For example, if you want to gain consent from a user before storing their data.
danger
Whether MHCT is enabled does not persist across page loads. You will need to handle persistence outside mhct.js
In order to do this, you will need to first disable MHCT using the enabled
option:
<script>
var _mhct = _mhct || [];
_mhct.push(['mhCampaignID','VA-00001']);
_mhct.push(['enabled',false]); //Disable Mediahawk
!function(){var c=document.createElement("script");c.type="text/javascript",c.async=!0,c.src="//www.dynamicnumbers.mediahawk.co.uk/mhct.min.js";var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(c,i)}();
</script>
Then once you are happy to track the user, you can enable MHCT using the enabled(true)
method which will begin tracking the user and change any telephone numbers.
<script>
//If the user is happy, load MHCT
mhct.enabled(true);
</script>