Widget with outlinks grouped by Page / Section

Hi all,
I have to develop a plugin/widget to show outlinks grouped by page and section.
For example:


- Home page
---- Header
-------- http://..site1...
-------- http://..site2...
---- Menu
-------- http://..site3...
-------- http://..site4...
---- Footer
-------- http://..site5...
-------- http://..site6...
- About
---- Social Network
-------- http://..site7...
-------- http://..site8...
---- Forum
-------- http://..site9...
-------- http://..site10...

How can I do this? Do I have to use the JS function “trackLink( url, linkType, customData )” with a valorized customData attribute? How can I read the “customData” attribute in my plugin?

Thank you in advance for your help!