Saturday, December 19, 2015

Mobile Income Report #17 - November 2015

previous parts
  Mobile Income Report #16 - October 2015

  Mobile Income Report #15 - September 2015
  Mobile Income Report #14 - August 2015
  Mobile Income Report #13 - July 2015
  Mobile Income Report #12 - June 2015
  Mobile Income Report #11 - May 2015
  Mobile Income Report #10 - April 2015
  Mobile Income Report #9 - March 2015
  Mobile Income Report #8 - January and February 2015
  Mobile Income Report #7 - December 2014
  Mobile Income Report #6 - November 2014
  Mobile Income Report #5 - October 2014 
  Mobile Income Report #4 - September 2014 
  Mobile Income Report #3 - August 2014
  Mobile Income Report #2 - July 2014
  Mobile Income Report #1 - June 2014
  Apps page - Portfolio (what are my assets?)

 If you do not want to miss any of my Income Reports you can follow me on Twitter. Just click the button above.

 Under Apps page you can see my portfolio. It is list of the games that are then reported in Income Reports. The portfolio is regularly updated with new information (releases for new platforms, new updates, ...)

What I did in November

  •  Jupiter, who stands behind Shards graphics and levels, prepared 10 new levels. Android version at Google Play is already updated.

  •  I finally dived into WPF as I choose it as a technology I want to build our match-3 level editor on. I really like it and editor is now finished. So, we can finally continue our work on this game, which I believe a lot in. Here is screenshot from the tool - most of the icons are test ones just to create working tool:
  • trying to make one of our HTML5 games work with new Windows Store. It is really easy to make it run, but the hard part was to make Google Analytics work and we also struggled with required graphical assets (icons, tiles) - big resolution for these is required, while size limits are pretty restrictive. On making 3rd party Google Analytics SDK ("Google Analytics SDK for Windows and Windows Phone") work I wrote tutorial here,
  • still learning Unity. After publishing our first game we made in it (Futoshiki) I think it is time to make something more complex with it. I always loved games with pixel characters, so this may be the way...


 Now, for the sad part - financial data. Here is income from paid versions:

 And here is percent split:
 ... almost all income from Shards.

 Figures for free apps supported with ads:

 There is decrease from $142,2 in October to $110,2. Biggest one is in AdMob income - from $42.6 to $25,6 - October was really good month for AdMob, now it returned back to regular numbers.

 Still most profitable network is Chartboost.

 Additionally, we got some small profit from HTML5 games - $95,80.

 Total income for November is $17,1 + $110,2 + 95,80 = $223,1. It is 43,9% increase, but only thanks to income from HTML5 games.


 In December I am working on our match-3 game. Thanks to finished level editor, we can move forward. Also working on preparing our first game for Windows Store. And still learning Unity.

Monday, December 14, 2015

How to make "Google Analytics SDK for Windows and Windows Phone" work with Windows 10 Javascript application.

 In past day I had to implement Google Analytics (GA) into Universal Windows 10 app written in HTML5/Javascript. Due to security restrictions it is not possible to add it in standard way - loading external Javascript libraries. I searched internet and found "Google Analytics SDK for Windows and Windows Phone" SDK at Codeplex. Unfortunately, making it work took me some time, so in this article I will share my findings.

Google Analytics SDK for Windows and Windows Phone

"Google Analytics SDK for Windows and Windows Phone" is available here. It comes in two flavours:
  • NuGet package written in C#,
  • vsix install package written in C++ (recommended for Javascript and C++)
 As author (timgrenfield) says:
 "The vsix installs a 100% native version (written in C++). The NuGet package is 100% managed (written in C#). While the C# version will work just fine in JS apps, the native version is recommended for JavaScript apps because it removes the dependency on the CLR (Common Language Runtime) and therefore will result in slightly better performance, lower memory usage, and better battery life for apps."
 In case of using NuGet version you can use "Any CPU" as architecture. In case of vsix package you have to to use separate x86, x64 and ARM architectures - "Any CPU" will not work. Three separate architectures result into Windows Store package to be 3 times bigger as it contains your game or app three times (once for every architecture). Fortunately, Windows Store should be clever enough to deliver only the correct one to user, when downloading your app from store.

NuGet package

 Now come the bad news: NuGet nor vsix did not work for me. I am not experienced in NuGet packages, so I would be happy if anyone could update this article if they find working solution. Problem with NuGet was: references under References in Visual Studio Community 2015 (VS) were marked with small yellow warning triangle after installation. Removing them and adding back by hand removed these warnings, but during compilation there were complains about missing win10{} in project.json file (which was missing completely). As I am not NuGet guy, I got lost.

vsix package

 I focused on vsix package, as it is recommended for Javascript apps and it was my case. After vsix installation go to References in Solution Explorer (right click → Add References)

 In Extensions tick Google Analytics SDK. But be sure to tick the right one – in right panel you can see properties, so choose the one with Targets UAP 10.0 (Universal application):

When compiling, be sure to set target architecture to x86, x64 or ARM:

 Now, building for ARM and x86 works, while attempt to build for x64 fails:

 Reason for this is missing dll library. Go to:
c:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\GoogleAnalytics.Native.SDK.Win10\1.3\Redist\CommonConfiguration\
 (you can get this path if you place mouse cursor over extension name)

And you will find, that x64 directory is missing (it is missing already in vsix package – you can open it with zip and watch):

 Solution is to build missing dll from source:

1) go to and download latest source code.

2) open GoogleAnalytics.VS2015.sln in VS,

3) change build to Release and select Configuration Manager … at the top:

4) change platform for Google.Analytics.Native.Win10 to x64:

5) build Google.Analytics.Native.Win10 from Build menu:

6) to make things more dramatic, there is syntax error in PlatformInfoProvider.cpp – you have to delete the "=" sign and run build again:

7) in your project root, there should be now new directory x64\Release\GoogleAnalytics.Native.Win10\ with compiled dll:

8) take it and copy it into x64 directory where library is missing (c:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\GoogleAnalytics.Native.SDK.Win10\1.3\Redist\CommonConfiguration\)

 Now, when building package for Windows Store select architectures like this:

Using Google analytics in code

 To use Google Analytics in your Javascript code, initialize it first with config, where most important part is your Google Analytics tracking Id:

    var config = new GoogleAnalytics.EasyTrackerConfig();
    config.trackingId = "UA-XXXXXXXX-Y";
    config.appName = "My app name";
    config.appVersion = "";
    GoogleAnalytics.EasyTracker.current.config = config;

 Track events and page views like this:

    GoogleAnalytics.EasyTracker.getTracker().sendEvent("category", "action", "label", 0);

 Now you can switch to you Goole Analytics console and check if you see new users, page views and events.