analytics goals, and encoding cleanup

Signed-off-by: Marc MacLeod <marbemac@gmail.com>