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

[creativ_button url=”https://www.scirra.com/store/construct2-plugins/construct2-cordova-plugins-1662″ icon=”shopping-cart” label=”Cranberrygame – Cordova Plugins for C2″ colour=”green” colour_custom=”” size=”medium” edge=”straight” target=”_blank”]

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.

[creativ_button url=”https://www.google.com/analytics/web” icon=”” label=”Google Analytics” colour=”orange” colour_custom=”” size=”medium” edge=”straight” target=”_blank”]

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.

[creativ_button url=”http://cocoon.io” icon=”user” label=”Cocoon.io Dashboard” colour=”blue” colour_custom=”” size=”medium” edge=”straight” target=”_blank”]

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 January 31, 2021
Was this article helpful?

Related Articles

Not the solution you were looking for?
Click the link below to submit a support ticket
Visist our Forum!

Leave a Comment

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