[AdobeDTM] Multichannel View (last touch) in one CID
If you need a Multichannel View on your extarnal campaigns and you need it beside the Marketing Channels in Adobe Analytics, the following code could help you. You need a Data Element wich will host the following custom code.
var _cid = _satellite.getQueryParam("cid"), _mid = _satellite.getQueryParam("mid"), _a=document.createElement('a'); _a.href = document.referrer; var _wR = _a.host, _r = ""; if (_mid) { _r = "Newsletter"; } else if (/XYZ1/i.test(_cid)) { _r = "SEA"; } else if (/XYZ2/i.test(_cid)) { _r = "Google Retargeting"; } else if (/XYZ3/i.test(_cid)) { _r = "Affiliate"; } else if (/XYZ4/i.test(_cid)||/facebook\.com/i.test(_wR)||/twitter\.com/i.test(_wR)||/plus\.google\.com/i.test(_wR)||/youtube\.com/i.test(_wR)) { _r = "Social Media"; } else if (_cid) { _r = "Unknown Campaign"; } else if (!_cid && (/google\./i.test(_wR)||/bing\.com/i.test(_wR))) { _r = "SEO"; } else if (/YOURURL\.com/i.test(_wR)||/ANOTHERURLOFYOURS\.com/i.test(_wR)) { _r = "Internal"; } else if (/paypal\.com/i.test(_wR)||/postpay\.de/i.test(_wR)||/sofort\.com/i.test(_wR)||/giropay\./i.test(_wR)||/mastercard\./i.test(_wR)) { _r = "Payment"; } else if (window.document.referrer!="") { var dr = window.document.referrer; _r = dr.split('/')[2]; } else { _r = "Typed/Bookmarked"; } return _r
You also need a PLR. The condition should be the created Data Element and the value should be
^((?!Internal|Payment).)*$
With this kind of condition the eVar will just be overwritten with external channels (internal and payment traffic is excluded).The rest is just an eVar wich will be set as the Data Element you created before.











