first commit with analytics. Perhaps put the externs in too many places?