How to call native code from line item?


What I need is this:

I want to use the features of a normal line item (like targeting, geos, frequency caps etc.) to show an ad. If the user clicks on it, I want to execute native code in my app.

I have read about Custom Events on the wiki.

Can I use custom event classes to achieve this? - The way I understood is that you create a custom native ad network, but then all you can set is the eCPM cascade for it in the segments , but not specific line items. What am I missing?