Hi @RoystonPr ,
I dont think there is a way to do this in extension itself. You have to rely on custom code.
You can use custom code Adobe Launch rule action to set munchkin ID basis hostname/ URL as per your needs.
Below is sample code how you can achieve. Set Rule Event as "Core - DOM Ready" or "Core - Window Loaded" or "Core - Library Loaded" based on your need.(Any one event)
Set the action as a custom code with below code (Sample code needs to be fine tuned as per your needs. You will have to add hostname values along with Marketo ID and wsInfo value). I hope this helps!
//Define logic to set munchkin ID basis URL/ hostname
var munchkinId = "Your Default Production munchkin ID"
if(window.location.hostname === "Your Dev Website HostName"){
munchkinId = "Dev Munchkin ID goes here";
}
else if(window.location.hostname === "Your Stage Website HostName"){
munchkinId = "Stage Munchkin ID goes here";
}
//Munchkin script
(function() {
var didInit = false;
function initMunchkin() {
if(didInit === false) {
didInit = true;
Munchkin.init(munchkinId, {"wsInfo":"abcd"});
}
}
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);
})();