Trace using analytics whenever a deprecated api is used.
Fixes #1277