Accessing cell metadata from a widget

I have a custom widget. When the view renders, I would like to check the metadata of the cell it is rendering in, and then make certain display choices based on that cell metadata. Unfortunately, I see no reliable way to do this.

Does anyone have any pointers on how to achieve this?

(P.S. I have tried hacking around the issue using NotebookTracker, but that has proven unreliable, as NotebookTracker.activeCell has already moved on by the time the widget renders. Has anyone found a better solution?)