Fixing window scope inside closure;
Fixing issues with analytics objects because of the window scope;