Hi all,
Is there a possibility to inject the Marketo munchkin code in single pages rather than in the main header/footer?
Thank you
Michael
Solved! Go to Solution.
Sure, just remove it from the template and then add it in the HEAD of a particular page. But why?
We have a common platform for microsites around the world. Not all the regions have Marketo.
I'd recommend you still only include it once. In that common code block, check the current domain and decide whether or not to call Munchkin.init(), for example:
/(^|\.)(exclude-domain.com|exclude-another.net)$/.test(document.location.hostname) || Munchkin.init('XXX-YYY-ZZZ')
(This is a simple one-liner; in practice I would put the excluded -- or included, depending on the count of each -- domains in an array because it's easier to read.)