Ninjadoodle Posted March 11, 2015 Share Posted March 11, 2015 Hi Guys I'm trying to make a detailed tutorial on setting up the config file and was wondering if somebody could explain to me how the analytics work? I'm slowly trying to put together a resource for newbies to learn Panda, so this would really help! I found an old thread with an example, but the link is now broken. Thank you! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 11, 2015 Share Posted March 11, 2015 Just put your Google Analytics id to config:analytics: { id: 'your-analytics-id'}If you want to track events, use game.analytics.send function:game.analytics.send('my-event'); Quote Link to comment Share on other sites More sharing options...
SkyzohKey Posted March 11, 2015 Share Posted March 11, 2015 ^ Ninja :3 Check the documentation (here), the doc of the Analytics class is realy cool. This class seems to be easy to use, for example (If I understood) :game.createScene('Main', { init: function() { var gaID = 6635; this.analytics = new game.Analytics(gaID); // [...] } playerJump: function() { this.analytics.send("player", "jump", "info", "Player jumped !"); // [...] }}); Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 11, 2015 Author Share Posted March 11, 2015 Hi Guys Thank you for your help! Couple of dumb questions ... 1. We are talking about Google Analytics here right?2. What happens when the game is offline? Thanks again! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 11, 2015 Share Posted March 11, 2015 Yep Google Analytics, and works only online. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 11, 2015 Author Share Posted March 11, 2015 Hi @enpu Thanks again, what I was meaning - is there going to be an error or crash, when offline and the analytics can't be sent? Quote Link to comment Share on other sites More sharing options...
enpu Posted March 11, 2015 Share Posted March 11, 2015 Nope, it just doesn't do anything when offline. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 11, 2015 Author Share Posted March 11, 2015 Awesome, thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.