Marketo’s custom JavaScript tracking code, called Munchkin, tracks all visitors who visit your Hub so you can react to their visits with automated marketing campaigns. Anonymous visitors are also tracked along with their IP addresses and other information. Without this tracking code, you will not be able to track visits or other activity on your hub.
Adding Marketo Tracking Code to Your Hub:
Use the Asynchronous Munchkin code and place it inside the Hubs > Custom Code of your Hub or in your Google Tag Manager.
<script type="text/javascript">
(function() {
var didInit = false;
function initMunchkin() {
if(didInit === false) {
didInit = true;
Munchkin.init('CHANGE-ME');
}
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//munchkin.marketo.net/munchkin.js';
s.onreadystatechange = function() {
if (this.readyState == 'complete' || this.readyState == 'loaded') {
initMunchkin();
}
};
s.onload = initMunchkin;
document.getElementsByTagName('head')[0].appendChild(s);
})();
</script>
To add the above Munchkin code to your Hub, navigate to Hubs > Select the Hub > from the Hub menu, click Custom Code. Add the code in the Code Section and Save.
The Munchkin code created is displayed on the Custom Code page, where you can use the toggle to enable or disable the code.
Tracking the Hushly Events in Marketo
Marketo does not support tracking of custom events. As a workaround, we propose to use the Munchkin Function to trigger a link click event.
Hushly's Solution:
If you want to track user actions in Marketo, one effective method is to use the "Clicked Link on Webpage" activity.
This is particularly useful when you want to monitor engagement with specific assets on your pages. Simply ensure that the asset or element includes a clickable link that Marketo can detect and log as a Clicked Link activity.
To track Hushly events such as Content View, Content Interaction, Form Submits, and more in Marketo, you can use the Munchkin tracking code along with some additional JavaScript.
hushly('bind', 'content-view', function(options) {
Munchkin.munchkinFunction('clickLink', {
'href': '/hushly/activity?utm_source=Hushly&utm_action=content-view&utm_content=' + options.assetName
});
});
hushly('bind', 'content-interaction', function(options) {
Munchkin.munchkinFunction('clickLink', {
'href': '/hushly/activity?utm_source=Hushly&utm_action=content-interaction&utm_content=' + options.assetName
});
});
hushly('bind', 'invalid-form-submit', function(formData) {
Munchkin.munchkinFunction('clickLink', {
'href': '/hushly/activity?utm_source=Hushly&utm_action=invalid-form-submit&utm_content=' + formData.assetName
});
});
hushly('bind', 'form-submit', function(formData) {
Munchkin.munchkinFunction('clickLink', {
'href': '/hushly/activity?utm_source=Hushly&utm_action=form-submit&utm_content=' + formData.assetName
});
});
Go to Setup > Settings > Event Handlers section and paste the above code.
Hushly Events displayed in Marketo
Related Topics:
Google Analytics 4 Integration
Google Ads Integration Information & Setup
Google Tag Manager (GTM) Information and Setup
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article