Re: [ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2015-06-07 Thread Val Waeselynck
I did try that initially, I wrote the following ga.ext.js file: var ga = function(){}; It did not work, the name got munged. That's why I used another approach after. This may be my build process that's broken, but that would surprise me, since I did manage to write an extern file for the

[ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2015-06-07 Thread Val Waeselynck
Le jeudi 17 juillet 2014 09:36:02 UTC+2, Thomas Heller a écrit : Hey, the problem is not that closure munges the window.ga function, it is that closure creates a var named ga which can be anything but is not the analytics ga. At least it was in my case. My solution was to use the

[ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2015-06-07 Thread Val Waeselynck
Alright, I managed to get it to work. I'm not expert enough in Closure to understand why, but what made it work for me was that the function was local-bound, i.e the following didn't work: (def ga (aget js/window ga)) ;; ... and later in the code (ga create my-account-id auto) However, the

Re: [ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2015-06-07 Thread Daniel Kersten
How about writing an extern for the ga function? Presumably the closure compiler will prevent name clashes then? On Sun, 7 Jun 2015 13:59 Val Waeselynck val.vval...@gmail.com wrote: Alright, I managed to get it to work. I'm not expert enough in Closure to understand why, but what made it work

[ClojureScript] Re: Trying to compile calls to new google analytics API fails with advanced compilation

2014-07-17 Thread Thomas Heller
Hey, the problem is not that closure munges the window.ga function, it is that closure creates a var named ga which can be anything but is not the analytics ga. At least it was in my case. My solution was to use the renaming feature of the analytics snippet to use a name closure won't