1. Home
  2. Game Developing
  3. Construct 2
  4. Tutorials
  5. Google Analytics for Construct 2 and CocoonIO
  1. Home
  2. Mobile Built Services
  3. CocoonIO
  4. Plugins
  5. Plugin-Cordova
  6. Google Analytics for Construct 2 and CocoonIO

Google Analytics for Construct 2 and CocoonIO

Google Analytics

Google Analytics helps you to track your user behaviors in your game. This will deliver data for improving your game to fit the users needs.

Cocoon

At the moment Cocoon has no offical Analytics plugin, yet. But you can use the “Cordova Analytics” Plugin made by Cranberrygame.

Important!

Note, you’ll need a premium plugin by Cranberrygame in order to use Google Analytics in your Construct 2 game. Please get it here

  Cranberrygame - Cordova Plugins for C2

Install the Plugin

Once you own a license for the Cordova Plugin package by cranberrygame, unzip it and go to the …\12_Cordova_extension_analytics\… folder and drag’n’drop following file into Construct 2.

[code]cranberrygame_CordovaGoogleAnalytics_1.0.12[/code]

 

Then a little window pops up. Click Install.

install_plugin_analytics

Restart Construct 2, then the plugin can  be used.

Construct 2 Code

Now you can import the plugin into your Construct 2 project.

import_plugin_analytics

The plugin overs two actions.

  • Track Screen (for the current screen like “settings”, “game” and so on)
  • Track Event (for tracking, for instance what button gets pressed and so on)

So you can create a global event sheet and a function in order to track your events and screens, or you add a tracking action to each event (I recommend to use a function). We will provide an example file soon.

Google Analytics Tracking ID

IMPORTANT

It seems that Google Analytics is not allowing to add analytics for apps and games anymore. They only offer Firebase now as analytics tool. However there is no working Construct 2 plugin yet.

Login to your Google Analytics account over here.

Google Analytics

Then go to the “Manage” tab and create a new property.

ga_create_property

After that, select “Mobile App” and enter the needed information like the app name.

ga_create_property2

Click on Create ID in order to get your ID. Copy your ID from here and insert it at the Cordova GoogleAnalytics Plugin.

ga_create_property3

For that, just select the plugin in your Construct 2 project.

ga_create_property4

Install the plugin in Cocoon

Please visit your Cocoon Dashboard and select your project.

  Cocoon.io Dashboard

Then go to the “Plugins” tab and choose “Custom”. Enter there following Repo-URL.

https://github.com/danwilson/google-analytics-plugin.git

Please note, that the link above doesn’t work anymore with the latest Cocoon version. Please use this link instead.

[code]https://github.com/AndreasReitberger/google-analytics-plugin.git[/code]

 

and click Install. (Don’t forget to save then!)

cio_install_plugin

Build your game and you’re done! Google Analytics will show the first data in the next few hours.

Updated on July 9, 2017

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.