Refactor to allow analytics to be included via an include file