Updating to code from https://github.com/igrigorik/ga-beacon