moved the influx duplicated code into its own javascript file
separate the serialisation from the gulp task for analytics