In response to @aseelund's post:
Creating an Event Based Rule instead of adding code in the Adobe Analytics Tool config is a viable option, however, I do not recommend using _satellite.isOutboundLink(), for the following reasons:
- _satellite.isOutboundLink() is not on the list of methods marked as public facing. To be fair, the chances of Adobe updating this function at this point are pretty slim, but it's still generally bad practice to go against the docs.
- Adobe Analytics Tool > Link Tracking (s.linkInternalFilters) performs a substring ("contains") match against the target URL (which may or may not include the query string, depending on whether or not you enable "keep URL parameters" (s.linkLeaveQueryString). Meanwhile _satellite.isOutboundLink() performs an end of string ("ends with") comparison against the target URL's hostname. Because matching methodologies do not align, you may get unexpected results!
- _satellite.isOutboundLink()matches against _satellite.settings.domainList (DTM property level config), which may or may not line up with the domain(s) you may normally want to specify in Adobe Analytics Tool > Link Tracking (s.linkInternalFilters). One common example is if you have subdomains on your root .mysite.com domain that you may want to consider as exit links. Or if you have a lot of domains and just want to specify a common value e.g. "mysite". Or, (not) matching start of string values, such as "javascript:" or "mailto:"
So, if you want to go the Event Based Rule route, you should skip the bit about _satellite.isOutboundLink() and instead modify the Property = Value regex condition to include domains you do not want to track as exit links.
For example:
Property: href
Value: ^(?!.*(tel:|javascript:|mailto:|\.mysite\.com)).*
Though, depending on how long your internal domain list is (or if you want to avoid regex), you may want to instead do a custom code condition with something like this:
// list of values to match against to NOT trigger exit link tracking
// note that this is a substring match, which is how Adobe Analytics linkInternalFilters works
var internal = [
'tel:',
'javascript:',
'mailto:',
'.mysite.com'
];
var href=this&&this.href||'';
for (var d=0,l=internal.length;d<l;d++) {
if ( ~href.indexOf(internal[d]) ) return false;
}
return true;