Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

EZ Analytics for Android Released

I am pleased to announce my first Unity3D plugin is now available for download. EZ Analytics for Android offers Unity3D developers a native solution for Google Analytics with as little as two lines of code.

Features

  • Easy implementation
  • Well documented
  • Great support
  • Track views / screens / scenes
  • Send event information such as button clicks or gestures
  • Send social event information such as Facebook likes or Twitter tweets
  • Track transaction information

Installation Instructions

When importing, if /Assets/Plugins/Android/ApplicationManifest.xml already exists, do not import from EZ Analytics as it will override the existing version. Instead, add the following three lines to your manifest if they don’t already exist:

<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

This plugin relies on Android native resources so the Google Play Services library must be added to your Android plugins folder. This can typically be found here:

$ANDROID_HOME/extras/google/google_play_services/libproject/google-play-services_lib

In a script on one of your GameObjects, add the following line to the Start() method replacing the tracking code with your own:

EZAGoogleManager.init("UA-XXXX-XX");

After, you can use any of the following methods in your project:

public static void init(string propertyId);
public static void sendView(string screenName);
public static void sendEvent(string screenName, string eventCategory, string eventAction);
public static void sendSocial(string screenName, string socialNetwork, string socialAction, string socialTarget);
public static void sendItemData(string transactionId, string productName, string productSku, string productCategory, double price, long quantity);
public static void sendException(string screenName, string description, bool isFatal);

Issue Tracker

https://bitbucket.org/nraboy/ez-analytics/issues

Nic Raboy

Nic Raboy

Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.