var em=window.addEventListener?”addEventListener”:”attachEvent”;var ev=window[em];var me=em==”attachEvent”?”onmessage”:”message”;ev(me,function(e){if(e.data.indexOf&&e.data.indexOf(“resize::”)!=-1){var height=e.data.replace(“resize::”,””);document.getElementById(“inevent-form-iframe”).style.height=height+”px”}},!1);var inparams=decodeURI(window.location.search).replace(‘?’,”).split(‘&’).map(function(param){return param.split(‘=’)}).reduce(function(values,[key,value]){values[key]=value;return values},{});if(inparams.utm){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm=”+inparams.utm;}if(inparams.utm_source){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm_source=”+inparams.utm_source;}if(inparams.utm_medium){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm_medium=”+inparams.utm_medium;}if(inparams.utm_campaign){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm_campaign=”+inparams.utm_campaign;}if(inparams.utm_term){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm_term=”+inparams.utm_term;}if(inparams.utm_content){document.getElementById(“inevent-form-iframe”).src=document.getElementById(“inevent-form-iframe”).src+”&utm_content=”+inparams.utm_content;}; window.addEventListener(“message”, function(event) { if (event.data && event.data.iframeAnalytics) { // event.data contains tracking events } }, false);
Source: Architecture Today