rockymadden / gap

:nut_and_bolt: Fix default Google Analytics tracking methodologies and track micro user behaviors.
https://rockymadden.com/gap/
81 stars 6 forks source link

Fixes browserify support #7

Closed alexgorbatchev closed 11 years ago

alexgorbatchev commented 11 years ago

root variable is determined based on existence of exports and alternatively defaults to this which when used with <script/> is window... However if the module is packaged with any tool like browserify, this context ends up being some king of define function used to package files instead of window.

It feels that root should always be window. Also, I would like to optimize some variable references like root.document which don't get minified right now.

Thoughts?

rockymadden commented 11 years ago

Thanks a lot Alex, spot on on all counts!