[backport] Fix missing injection of analytics service on related tasks directive.