Added code for widget tracking