[Plugin] Google Analytics

Post your completed addons to share with the community

Post » Thu Jul 31, 2014 7:25 pm

Thanks @suntemple.
B
11
S
2
Posts: 24
Reputation: 753

Post » Mon Aug 25, 2014 2:20 pm

Does this plug-in work on android and IOS devices via cocoonjs?

Thanks,

Mike
B
49
S
9
G
4
Posts: 425
Reputation: 7,037

Post » Mon Aug 25, 2014 5:46 pm

@Brashmonkey, Sorry Mike, it doesn't. But it seems to be their Javasript VM limitation - can't load external scripts (I may be wrong but it seemed like that in the debugger).
B
9
S
3
Posts: 55
Reputation: 767

Post » Mon Aug 25, 2014 6:16 pm

suntemple wrote:@Brashmonkey, Sorry Mike, it doesn't. But it seems to be their Javasript VM limitation - can't load external scripts (I may be wrong but it seemed like that in the debugger).

@suntemple , I'm not sure if you already checked this, but it ended up being the issue with the Spriter plugin not working in cocoonjs.

The details are discussed in the Runtime overview documentation under the heading Google Closure Compiler compatibility, but I'll paste the relevant text here:

SDK Documentation wrote:If you refer to external libraries, you must always use bracket syntax (i.e. Object["property"]). If you use dot syntax, Closure Compiler will rename the property and it will access the wrong property of the external library after export.


The closure compiler is used whenever minify script is used which is always the case with cocoonjs.
Spriter Dev
B
99
S
21
G
12
Posts: 3,259
Reputation: 16,894

Post » Mon Aug 25, 2014 7:42 pm

@lucid, thanks Lucid. The GoogleAnalytics plugin 'survives' the minification. It has some global 'ga(...' calls but they are not optimizied. I tried to look into the issue and found out the problem is the cocoonjs export does not insert script dependencies into index.html. I have put the google analytics initialization into a dependency script ga_init.js and thus it wasn't executed in cocoonjs exported version. I'll try to integrate the initialization script into runtime.js directly instead.
B
9
S
3
Posts: 55
Reputation: 767

Post » Tue Aug 26, 2014 4:49 am

@suntemple please do, I really want to use this in my app. Will Flurry work for cocoonjs iOS until you can fix it?
B
19
S
5
G
2
Posts: 72
Reputation: 1,846

Post » Tue Aug 26, 2014 8:06 am

@Whack, I moved the initialization to runtime.js, bracked-syntaxed it and it works for me in browser. Since there's no dependencies, it should throw no runtime errors from within Cocoonjs too.

But whether GA will send actual data from within CocoonJS remains a question :)

You can get this version of the plugin here

Could you please let me know if it works for you? Thanks!
B
9
S
3
Posts: 55
Reputation: 767

Post » Tue Aug 26, 2014 8:08 am

@Whack
Whack wrote:@suntemple please do, I really want to use this in my app. Will Flurry work for cocoonjs iOS until you can fix it?


Regarding Flurry, I tried it some time back with CocoonJS 1.4.7 and it didn't work for me. Maybe now it's different.
B
9
S
3
Posts: 55
Reputation: 767

Post » Tue Aug 26, 2014 2:40 pm

@suntemple I'm testing the new plugin now, I work in less than a half hour but after I'm out I should be able to report back with details on whether it works or not. Thanks!
B
19
S
5
G
2
Posts: 72
Reputation: 1,846

Post » Tue Aug 26, 2014 3:03 pm

@suntemple it works on pc, but it doesn't seem to be reporting any data on cocoonjs :(
B
19
S
5
G
2
Posts: 72
Reputation: 1,846

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests