Search Unity

Easy Analytics Unity plugin for Android, iOS and WebPlayer

Discussion in 'Assets and Asset Store' started by Damien_C4M, May 3, 2013.

  1. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    C4M has released its Easy Analytics plugin on the Unity Asset store. This is the thread to discuss problems, feature requests or pre-buying inquiries.
    Thank you for interest in our Easy Analytics plugin.

    http://u3d.as/content/c4mprod/easy-analytics/4z1
     
  2. antiping_Unity

    antiping_Unity

    Joined:
    May 31, 2011
    Posts:
    22
    when I run the example demo in Nexus 7, the app crashes at the beginning. I build it in Unity3.5.6
     
  3. antiping_Unity

    antiping_Unity

    Joined:
    May 31, 2011
    Posts:
    22
    problem has been solved, you put the plugins folder in Easy Analytics folder, I did not notice and direct build it,so crashed.
     
  4. HikerGames

    HikerGames

    Joined:
    May 20, 2013
    Posts:
    1
    I run the example demo in Galaxy S3 but it look like can't send data to google server, the report still is blank ( both normal and real-time report )
    I changed
    EasyAnalytics.Instance.trackerWithTrackingId("xxxxxx");
    to our tracking id

    FIXED : I forget change the bundle id in manifiest.xml :) , it's working now
     
    Last edited: May 20, 2013
  5. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Glad that you worked it out.
    Please don't hesitate to ask for help here.

    And also, if you have time, drop a good review on the assets store, it will help plugin development.
     
  6. Hemingway72

    Hemingway72

    Joined:
    Sep 24, 2012
    Posts:
    2
    Trying to compile for iOS, getting the following linking errors:

    Undefined symbols for architecture armv7:
    "_trackerWithTrackingIdImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_setStartSessionImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_setCustomMetricImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendViewImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_setReferrerImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendTransactionImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_setCustomDimensionImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendTimingImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendSocialImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendExceptionImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_setCampaignUrlImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    "_sendEventWithImpl", referenced from:
    RegisterMonoModules() in RegisterMonoModules.o
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
  7. -JohnMore-

    -JohnMore-

    Joined:
    Jun 16, 2013
    Posts:
    64
    Hello,

    I'm having some trouble making this work, so any help is more than welcome.

    My game does not have a dedicated AndroidManifest, I'm using the one that Unity generates for me. I have copied the Android folder from EasyAnalytics/Plugins into my Asset/Plugins folder. Inside this folder, I have edited the AndroidManifest.xml file so this line reads like this:
    HTML:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.<MyCompany>.<MyGame>" android:versionName="<MyVersion>" android:versionCode="1">
    Also, when loading the scene I wrote:
    Code (csharp):
    1. EasyAnalytics.Instance.trackerWithTrackingId("<MyGACode>");
    2. EasyAnalytics.Instance.setStartSession(true);
    3. EasyAnalytics.Instance.sendView("/main screen");
    Now, I think this plugin does not work from inside the editor but the problem is that while the game compiles and runs great in android, no data is being received by Google Analytics. Nor the realtime graphs, not the standard graphs. So I think I'm messing up something but don't know what.

    Thanks.
     
  8. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @ Hemingway :

    Check the following points :
    1.The package file are most certainly not at the right location, make sur the "Plugin" folder is right under the "Asset" folder:

    +Assets
    -CHANGES.txt
    -EasyAnalytics.cs
    -EasyCodeScanner.unity
    -EasyCodeScannerExample.cs
    +Editor
    +Plugins
    +Android
    +iOS
    +WebPlayer
    -README.txt

    2. In the generated iPhone project you have the GAITrackerWrapper.mm file under the libraries folder
    3. The GAITrackerWrapper.mm file has the Unity-iPhone Target Membership checked (on the right panel) - very important !
     
  9. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @ -JohnMore-

    No you are right the analytics is not enabled in the Editor, but just on the devices.

    First question, does the provided example works correctly with your tracking id? The provided example should correctly run out of the box since it has very recently successfully been tested for the lastest release few days ago.

    Then check you have the ACCESS_NETWORK_STATE and INTERNET permissions and of course internet data connection on the device.
     
  10. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    I'm interested in this but I would like to look over the documentation first so I can see how it works and what I can do with it. Is the documentation available?
     
  11. valyard

    valyard

    Unity Technologies

    Joined:
    Jun 4, 2010
    Posts:
    291
    This doesn't work in a standalone windows build, right?
     
  12. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Currently no, but we could add it using the Measurement Protocol APIs. We'd be happy to consult a few days for you.
     
  13. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
  14. guanzhenbin

    guanzhenbin

    Joined:
    Mar 29, 2013
    Posts:
    1
    The plugin have any demo or video?
     
  15. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    No, sorry.
     
  16. WPCJack

    WPCJack

    Joined:
    Mar 15, 2013
    Posts:
    26
  17. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    Hi WPCJack,

    The EasyAnalytics plugin does not uses EasyTracker wrapper implementation of Google but rather the low level implementation and thus you cannot use the auto log exception feature.

    On android to activate the debug you can recompile the wrapper and uncomment the line 20 of GAITrackerWrapper.java, on iPhone you can activate it by modifying the GAITrackerWrapper.m class by adding the debug mode on the tracker instance.

    Do you have a log of the crash, maybe we could help?

    Best reagards
     
  18. bombapps

    bombapps

    Joined:
    Jul 11, 2013
    Posts:
    5
    Has anyone got this to work side by side with any of the Prime31 plugins? I'm not getting any errors compiling or in logcat but it's not tracking. If I setup an empty scene with no Prime31 plugins it works perfect. I tried every combination of Android manifests I can think of.

    Maybe this needs to be implemented:

    https://gist.github.com/prime31/0908e6100d7e228f1add

    SOLVED:

    In case anyone else runs into this, I was able to get this working by editing the plugin to be compatible with Prime31 (and other Unity plugins) by following the gist above. The instructions aren't that clear so if you need a hand just ask.
     
    Last edited: Oct 14, 2013
  19. derrickl_dgs

    derrickl_dgs

    Joined:
    Oct 29, 2013
    Posts:
    3
    When do you plan to support the new Google Analytics V3 API?
     
  20. derrickl_dgs

    derrickl_dgs

    Joined:
    Oct 29, 2013
    Posts:
    3
    Your readme instructions are not very clear on this? For Android, does the bundle id in the AppManifest.xml file have to be the same as my app bundle id, eg "com.mycompany.myapp", or do I have to change my bundle id in my Android build setting to be "com.c4mprod.easyga" and also have "com.c4mprod.easyga" in my AppManifest?

    The latter way is the only way I have gotten the reporting to work, but I dont want to have to change my apps bundle id? How can I make this work using my own bundle id "com.mycompany.myapp"??
     
  21. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @derrickl_dgs
    You can change the bundle identifier to fit your needs, no needs to be exactly "com.c4mprod.easyga". About V3 yes, this API will be supported very soon.
     
  22. derrickl_dgs

    derrickl_dgs

    Joined:
    Oct 29, 2013
    Posts:
    3
    Thanks for the response guys. Not sure why I wasn't get hits on the Google Analytics dashboard before, but now its working great for me.
     
  23. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    Hey! Just bought your plugin. Looks great! For the idiots out there (ie me)-- would you be so kind to explain what exactly I need to change/personalize in the following to make it track my in app purchases?

    Code (csharp):
    1.     EasyAnalytics.Instance.sendTransaction("TRANSACTION_ID_12345",
    2.                                                 (long)(2.16 * 1000000),
    3.                                                 "In-App Store",
    4.                                                 (long)(0.17 * 1000000),
    5. 0,
    6.                                                 null, //null for auto currency, otherwise currency code only available on Android (ie : "EUR")
    7.                                                 "PRODUCT_SKU_1",
    8.                                                 "PRODUCT_NAME",
    9.                                                 (long)(1.99 * 1000000),
    10.                                                 1,
    11.                                                 "PRODUCT_CAT");
    Thanks so much!!
     
  24. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    hello? help!
     
  25. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @funasylum

    Well, normally you would have to change all the values, here is the doc of it (in EasyAnalytics.cs):

    // --------------------------------------
    // Ecommerce Tracking
    // transactionId : Transaction Id, should be unique.
    // orderTotal : Order total (in micros)
    // affiliation : Affiliation
    // totalTax : Total tax (in micros)
    // totalShipping : Total shipping cost (in micros)
    // currencyCode : Set currency code For the complete list of supported currencies and currency codes, see the Supported Currencies Reference.
    // productSKU : Product SKU
    // productName : Product name
    // productPrice : Product price (in micros)
    // quantity : Product quantity
    // productCategory : Product category
    // --------------------------------------


    -> transactionId : This is a compulsory id of a product, it should be there otherwise it will crash the google analytics lib
     
  26. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    Hi,

    I want to buy easy analytics to use google analytics in Unity3d.
    There is a AndroidManifest in the package, And I am using SocialNetworking, PlayGameServices, InAppBilling from Prime31 plugins that change AndroidManifest.
    Can I use your plugin with Prime31 plugins? Whats need to be in AndroidManifest for easy analytics?

    Thanks
     
  27. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hi Mojtaba,

    Thanks for your interest in EasyAnalytics for Unity3D.

    First of all, yes EasyAnalytics is compatible with the prime31 plugins since EasyAnalytics doesn't require to be the main activity in the manifest.

    What you need to add in the Android manifest is really simple:

    <!-- GAWRAPPER permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    and

    <!-- Used for install referral measurement-->
    <service android:name="com.google.analytics.tracking.android.CampaignTrackingService"/>
    <receiver android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver" android:exported="true">
    <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
    </receiver>

    in the application tag.

    Good luck with your project,

    Mathieu - C4M




     
  28. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    Thanks for the answer,
    I'm working with your package and it's good.

    I want to report Uncaught Exception automatically in IOS and Android, in last page someone asked it and you answered that you should change some code and recompile. But I really want an easy way to do it. I've bought your package to don't face native codes. So please help me with an easy way to report Uncaught Exception.

    Thanks
     
  29. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    I've got v1.4

    When I click sendTransaction in example scene the app crashes.
    How could I get Campaign URL in iOS?
     
  30. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @mojtaba64

    In the sendTransaction function the transaction id must not be null or the underlying Google API crashes, does the demo example works on your side?

    About Uncaught Exception, we will add in the next release an debug activation method to prevent you from recompiling the lib.
     
    Last edited: Nov 29, 2013
  31. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    Thanks,
    I've sent the game to one of my friends in another country and we faced a bug that crashes the game so I really need the Uncaught Exception report.

    Could you tell what exactly I should add to this line?

    I have not changed your code in demo example, btw It runs well on my project.
     
  32. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @mojtaba64

    To activate the debug mode you have to uncomment the line 12 of GAITrackerWrapper.m in the 1.4 version or equivalent for older versions

    //[[GAI sharedInstance].logger setLogLevel:kGAILogLevelVerbose];
     
  33. xanzarx

    xanzarx

    Joined:
    Dec 4, 2013
    Posts:
    4
    Hello I would like to buy your plugin. But I'm interested in one thing: your plugin is compatible with Google Analytics Mobile SDK v3? On the site (https://developers.google.com/analytics/devguides/collection/android/v3/) the SDK version 2 is marked as "Legacy".
    Will I have problems with Google Analytics because of the version?

    ------
    Sorry for the English - it's Google translator.
     
  34. randy_lee

    randy_lee

    Joined:
    Dec 4, 2013
    Posts:
    1
    Hi, I have a question about your plugin.

    If the user is offline, does it save all the data to be sent to Google Analytics once the user goes back online?

    Thanks.
     
  35. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @EvastDev

    The new plugin with Analytics V3 (the latest one v3.02) is now available (certinely under review while you posted :)
    https://www.assetstore.unity3d.com/#/content/7476


    @randy_lee

    Yes the Google Analytics Lib should handle that automatically for you, it stores everything in database and sends everything as soon as it can.
     
  36. xanzarx

    xanzarx

    Joined:
    Dec 4, 2013
    Posts:
    4
    I found a mistake in your plug-in! In realization for the android in the sendTransaction method. Category of a product always "Game expansions". (line 151) in the GAITrackerWrapper.java file
     
  37. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    How could I get Campaign URL in iOS?
     
  38. Ian-Backlund-at-Work

    Ian-Backlund-at-Work

    Joined:
    Oct 18, 2013
    Posts:
    18
    I understand that I have to add those permissions to the AndroidManifest.xml file for my project, but where is that file? When I create a test scene in Unity and import Easy Metrics I don't have an AndroidManifest.xml file for the project. If I do an android build a "\Temp\StagingArea\AndroidManifest.xml" is generated, but the .apk file is created immediately after that and I don't have a chance to change the AndroidManifest.xml file.
     
  39. Ian-Backlund-at-Work

    Ian-Backlund-at-Work

    Joined:
    Oct 18, 2013
    Posts:
    18
    Ok, I get it, you can't just import Easy Metrics, you have move everything one level up out of the Easy Analytics v1.4 folder.
     
  40. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
    @ EvastDev:

    Thanks a lot, I made the change and it will be fixed in the next release. Thanks a lot lot for pointing that
     
  41. Damien_C4M

    Damien_C4M

    Joined:
    Feb 8, 2013
    Posts:
    55
  42. mojtaba64

    mojtaba64

    Joined:
    Aug 3, 2010
    Posts:
    56
    Yes, exactly.
     
  43. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
  44. xanzarx

    xanzarx

    Joined:
    Dec 4, 2013
    Posts:
    4
    Your plugin sends the wrong information on the sessions. That's what I get reports on statistics (many short sessions, less than 2 seconds)
    $stats.jpg
    When starting the game I call:
    Code (csharp):
    1. EasyAnalytics.Instance.setStartSession (true);
    I think the reason is that you have incorrectly switched to version 3.
    You send data on start of the session each time you send out messages (screen, event, etc).
    Code (csharp):
    1.  
    2.     public static void setStartSession(boolean startSession) {
    3.         if (mGaTracker != null) {
    4.             if (startSession) {
    5.                 mGaTracker.set(Fields.SESSION_CONTROL, "start");
    6.             } else {
    7.                 mGaTracker.set(Fields.SESSION_CONTROL, "end");
    8.             }
    9.         }
    10.     }
    11.  
    The site google analytics (https://developers.google.com/analytics/devguides/collection/android/v3/migration) says that send data to the session so you need to :
    Code (csharp):
    1.  
    2.     mTracker = GoogleAnalytics.getInstance(this).getTracker(GA_PROPERTY_ID);
    3.  
    4.     // CAUTION: Setting session control directly on the tracker persists the
    5.     // value across all subsequent hits, until it is manually set to null.
    6.     // This should never be done in normal operation.
    7.     //
    8.     // mTracker.set(Fields.SESSION_CONTROL, "start");
    9.  
    10.     // Instead, send a single hit with session control to start the new session.
    11.     mTracker.send(MapBuilder
    12.       .createEvent("UX", "appstart", null, null)
    13.       .set(Fields.SESSION_CONTROL, "start")
    14.       .build()
    15.  
     
  45. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hi, happy new year.
    Big thanks for reporting this in detail, we're going to look at it today.

    We were off for the past week, and therefor the delay.

    More later,

    Mathieu
     
  46. Chris-Clark

    Chris-Clark

    Joined:
    Jan 16, 2012
    Posts:
    130
    Hi C4M,

    I have a question about how the Analytics SDK works on Android. Does it give me info on the 'referrer'? As in, will it tell me if my app was found by a Play Store search, direct link, top lists, etc.?

    Thanks!
    Chris
     
  47. C4MProdDev

    C4MProdDev

    Joined:
    Jul 9, 2009
    Posts:
    107
  48. C4M

    C4M

    Joined:
    Feb 7, 2013
    Posts:
    20
    Yes, if you link your GA account with your Google Play admin account.

    Best,
     
  49. Ian-Backlund-at-Work

    Ian-Backlund-at-Work

    Joined:
    Oct 18, 2013
    Posts:
    18
    Hello. Are you close to releasing the new version of the plugin with fixed session time information?
     
  50. Ian-Backlund-at-Work

    Ian-Backlund-at-Work

    Joined:
    Oct 18, 2013
    Posts:
    18
    I see that it has been upgraded to version 1.5 in the store. I assume that has the bug fix, but now it is only compatable with Unity 4.3.2. Our project is getting ready to release on Unity 2.2.2.f1 and we can't upgrade without breaking other things. Is upgrading Unity really necessary?