There are a lot of reasons to add a line of code to your app — all kinds of analytics and security and lifecycle 3rd-party services out there.
The granddaddy is Urchin / Google Analytics that let you drop a line of code in your HTML that would turn on user/visitor tracking.
These days my friends at Indicative (http://www.indicative.com) and ProdThink do analytics and user surveys triggered by action in your web app or mobile app. It’s neat. You can also embed chat and a zillion other things.
Seems to me though someone should make a universal embed sdk. Some code you put throughout your language or framework, so you can auto-instrument it. Like you query the app and IT gives you all its functions and events. From there you can label them. Strange it doesn’t exist. Or maybe it does? Does it?