Download the source code here:
http://www.redtgames.com/blog/integrating-google-analytics-to-cocos2d-x-game
- What is their behavior in each and every stage.
- Are they finding it hard or difficult to play.
- Any specific stage they are stuck at and not able to finish (annoyed).
- How many times they are losing or wining in a stage
- Are they even able to finish the complete game.
- Are they visiting your store and do they know that there is an in app purchase available
To me these data are valuable and they give me an opportunity to improve the game and have a better chance at selling it. Without these information it is like flying a plane in the blind and depending on your luck. We are not big companies, we are either sole developers or team of few enthusiastic entrepreneurs who want to create some awesome games :). We all know how hard this is. Even if we end up creating a reasonable game, competition against big companies are unsustainable. BUT, we can try, lets try.
There may be few frameworks to achieve this, I have decided to go with Google analytics. Lets get started.
- Get an account for Google analytics HERE
- Download the iOS SDK from HERE
Add the SDK to your cocos2d-x project.
<img alt="Google analytics SDK for XCode" height="255" data-cke-saved-href="http://i2.wp.com/redtgames.com/images/analytics_xcode.jpg?w=550" href="http://i2.wp.com/redtgames.com/images/analytics_xcode.jpg?w=550" p="" scale="2" data-cke-saved-src="http://i2.wp.com/redtgames.com/images/analytics_xcode.jpg?zoom=2&w=550" src="http://i2.wp.com/redtgames.com/images/analytics_xcode.jpg?zoom=2&w=550" src-orig="In your RootViewController.mm add the following method:
Add a new class named analyticsInterface.cpp (or whatever you want to call it) in your project.
From your GameLayer.cpp simply call the above method and pass the current screen name:
-
Download the source code here:
http://www.redtgames.com/blog/integrating-google-analytics-to-cocos2d-x-game
-