Release Notes: (1.4.5)
  • iOS arm64 architecture support added.

Integration Guide - Admob Ad Plugin

Platforms: Android & iOS
Plugin version: 1.4.5
Localytics iOS SDK version: 2.23.0
Localytics Android SDK version: 2.17.0

Generally you don't have to dive into the documentation from Localytics, simply follow a few steps below to get the plugin integrated in your App in minutes:

[1] Import the LocalyticsAnalytics[Android|IOS|Universal].unitypackage file to your unity project;

[2] Follow the instructions below to configure the plugin.

· >>> For Android platform, click on the menu item of Unity top menu bar: NeatPlug -> LocalyticsAnalytics -> Patch AndroidManifest. This is for generating a valid AndroidManifest.xml or patching the existing file with LocalyticsAnalytics support.


· >>> For iOS platform, click on the menu item of Unity top menu bar: NeatPlug -> LocalyticsAnalytics -> Patch iOS Configuration. This is for automatically adding iOS SDK frameworks, libraries or patching the Info.plist file (if needed) as long as the Xcode project is generated by Unity.

[3] Find LocalyticsAnalyticsAgent Prefab in Assets/Plugins/NeatPlug/Analytics/LocalyticsAnalytics/Prefabs/, open the first scene of your game, drag & drop the prefab into the scene.

[4] Okay, the integration is done here. Now set up Localytics by filling in a few properties of the LocalyticsAnalyticsAgent gameObject which you just dropped in the Hierarchy window. To do this, simply select that gameObject, and look at its properties in the Inspector window, you need to fill in:

   · Api Key [Android|IOS] - The Api Key of your App (You can get it from Localytics dev site).

Now it's the time to do logging!

[5] Call below functions to log an event, error or pageview:

   · LocalyticsAnalytics.Instance().Init(string apiKey) - Required if you don't apply "Api Key" property value for LocalyticsAnalyticsAgent.

   · LocalyticsAnalytics.Instance().TagEvent(...) - Tag an event.

   · LocalyticsAnalytics.Instance().TagScreen(...) - Tag a screen.

  There are other useful public methods that LocalyticsAnalytics provides, to use them, call LocalyticsAnalytics.Instance().method().
Show All   
public void Init(string apiKey)
/**
 * Initialization.
 * 
 * @param apiKey
 *            string - Your App API key, it can be got from Localytics Dev Site.
 * 
 * @param logUseHttps
 *            bool - True for using HTTPS for log data transferring, false for using HTTP.
 * 
 */
public void Init(string apiKey)
public void TagEvent(string eventId, string[] attributes = null, ... )
/**
 * Tag an event.
 * 
 * Records specific events in an opened session. 
 * Examples: "Button 1 was pressed" and "Player got to level 5".
 * 
 * Best Practices:
 * 
 * DO NOT use events, attributes, or dimensions to record personally identifiable information.
 * The best way to use events is to create all the event strings as predefined constants and 
 * only use those. This is more efficient and removes the risk of collecting personal information.
 * Do not tag events inside loops or any other place which gets called frequently. 
 * This can cause a lot of data to be stored and uploaded.
 * 
 * @param eventId
 *          string - The eventId for identifying the event.	
 * 
 * @param attributes
 *          string[] - Additional key/value pairs with data related to an event.
 *                     For instance: new string[]{"key1:val1","key2:val2"}
 * 
 * @param customDimensions
 *          string[] - A set of custom reporting dimensions. If this parameter is null 
 *                     or empty, then no custom dimensions are recorded.
 * 
 * @param customerValueIncrease
 *          long - Added to customer lifetime value. Try to use lowest possible unit, 
 *                 such as cents for US currency.
 */
public void TagEvent(string eventId, string[] attributes = null, string[] customDimensions = null, 
                       long customerValueIncrease = 0)
public void TagScreen(string screenId)
/**
 * Tag a screen.
 * 
 * Records screens visited in an opened session.
 * 
 * @param screenId
 *          string - The screenId for identifying the screen.
 *                  
 */
public void TagScreen(string screenId)
public void Upload()
/**
 * Manually upload data.	
 *      
 * Generally the data is automatically uploaded when app is pushed to background.
 * This function is for providing more flexibility of the time of uploading.
 * Call this function whenever you want to force uploading the data immediately.
 */
public void Upload()

[6] Build your App now. To compile for iOS platform, you need to have Xcode 4.5 (with iOS SDK v6) or above installed.

[7] Test and verify if events can be logged on Localytics's servers as expected, generally it takes several hours for reports to appear in your Localytics dev account, you need to be a little patient. If you encounter any exceptions, it would be helpful for you to address issues if you take a look at the logcat output (Android) or xcode debug console (iOS) to find the debug / error / warning messages.

[EOF] Should you have any questions or encounter any problems while integrating the plugin, please do not hesitate to shoot us an email at support@neatplug.com, we will be more than happy to help you. Thanks for choosing NeatPlug solutions!