Blog > Extract links from Marketo email

The Marketo email link performance report doesn't tell you what links aren't clicked yet exist in an email. Here's another nifty bookmark macro that will generate a csv file of all links in an email so you can combine it with your Marketo email link performance report for a more complete report.

Set up the bookmark with the code below - see my other blog post download email html for installation instructions.
Click the bookmark while in the preview email UI.

javascript:(function()%7Bif(window.location.hostname.indexOf(%27marketodesigner.com%27)!%3D-1)%7Bvar%20a%3Ddocument.createElement(%27a%27)%2Cb%3Ddocument.querySelector(%27iframe%27)%2Cc%3Db.contentDocument.getElementsByTagName(%27a%27)%2Cd%3Ddocument.querySelector(%27title%27).textContent%2Ce%3D%22Email%2CLink%20URL%2CTracked%20Link\n%22%3Bfor(var%20i%3D0%3Bi%3Cc.length%3Bi%2B%2B)%7Bvar%20t%20%3D%20c%5Bi%5D.classList.contains(%27mktNoTrack%27)%20?%20false%20:%20true%3Be%20%2B%3D%20d%2B%22%2C%22%2Bc%5Bi%5D.href%2B%22%2C%22%2Bt%2B%22\n%22%3B%7Da.download%3Dd.replace(/%5B%5EA-Za-z0-9%5D/g%2C%27_%27)%2B%27_links.csv%27%3Ba.href%3D%22data:application/csv%3Bcharset%3DUTF-8%2C%22%2BencodeURIComponent(e)%3Ba.click()%3B%7Delse%7Balert(%27Please%20preview%20a%20Marketo%20email%20to%20download%20links%27)%7D%7D).call(this)%3B%3Bvoid(0)%3B