Adobe External Links

This code matches all external links, based on Adobe Analytics internalFilters definition.

The following item shows up in the Variable Summary report under the OP Custom Tag. The account is External Links.
  • externalLinks0-nn: Shows all the external links by page.
  • externalLinks.length: Shows the count of pages with external links by page.
  • internalFilters: Shows a list of internal filters that were found on the page.
  • page: Shows the display URL and the actual URL of the pages where the download links were found.

To capture these details in an audit or Journey, paste the snippet below into an Execute Action:

function opReqGetAsync(paramObject, acct, callback) { 
var baseURL = "" + acct; 
var opReq = new XMLHttpRequest(); 
opReq.onreadystatechange = function() { 
if (opReq.readyState == 4 && opReq.status == 200){ 
}"POST", baseURL, true); 
function externalLinksCheck(){ 
var object = {}, 
extLinks = [], 
adobeObject = window['s'] || "s not found", 
links = Object.keys(document.querySelectorAll('a[href]')).map(function(key){return document.querySelectorAll('a[href]')[key]}); 
if(typeof adobeObject == "object"){ 
var regEx = new RegExp(s.linkInternalFilters.replace(/,/g,"|"),"g"); 
for (var i = links.length - 1; i >= 0; i--) { 
if(links[i] == -1){ 
}; = location.href; 
extLinks.length == 0 ? object.externalLinks = "No external links found" : object.externalLinks = extLinks; 
opReqGetAsync(object, "External Links"); 
} else { 
object.internalFilters = "Internal filters not found on current page"; 
opReqGetAsync(object, " External Links");} 
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.