Recently I had a client request to capture the link text associated with PDF downloads from their site. I scratched my head for awhile and finally decided the best option was to ask the Twitter community for help.
My good buddy Andreas came to the rescue.
The Goal
Capture ‘The Dude – A Complete Biography’, from the link below, into a custom conversion variable.
Jason is the Sr. Director of Community Solutions at Keystone Solutions.
If you are interested in partnering with Jason at Keystone, in need of analytics & optimization consulting, or looking for employment/internship possibilities, please feel free to email ‘jason [at] keystonesolutions [dot] com’
Omniture: Capture Download Link Text (code by @ad0815)
Recently I had a client request to capture the link text associated with PDF downloads from their site. I scratched my head for awhile and finally decided the best option was to ask the Twitter community for help.
My good buddy Andreas came to the rescue.
The Goal
Capture ‘The Dude – A Complete Biography’, from the link below, into a custom conversion variable.
The Code
var url=s.linkHandler(".pdf","d"); if(url){ var currentobj=s.eo?s.eo:s.lnk; if (currentobj && currentobj.innerHTML) { s.eVar1 = currentobj.innerHTML; s.linkTrackVars="eVar1"; } }The Result
Thanks Andreas, the code is clean, concise, and accomplished exactly what I needed!
NOTE: The above requires the addition of the linkHandler plugin to your s_code.js file.
Jason Thompson
Jason is the Sr. Director of Community Solutions at Keystone Solutions. If you are interested in partnering with Jason at Keystone, in need of analytics & optimization consulting, or looking for employment/internship possibilities, please feel free to email ‘jason [at] keystonesolutions [dot] com’
Twitter - Facebook - More Posts