Debug event reporting

By default, the Analytics SDK doesn't log much information to the console, to ensure it runs as efficiently as possible in the background of your game.

When setting up the SDK and instrumenting custom events, there are three options for debugging and confirming that the integration works as intended.

View events in the Debug Panel

New for version 6.0.0 of the Analytics SDK is the Debug Panel, which you can open from Services > Analytics > Debug Panel.

Keep the Debug Panel open as you test your game in the Unity Editor to display events as they are recorded and uploaded, along with other information such as whether the SDK has been activated and what user IDs are assigned to each event. You can also examine the raw JSON payload of each event to ensure that you are recording the data you want to record.

Note: The Debug Panel only shows events and uploads that occur while it is open. The Debug Panel will not display events recorded before it was opened.

The Debug Panel does extra work to marshall events for display while it is open. None of this logic executes outside the Unity Editor or when the Debug Panel is closed, so you can rest assured that the underlying SDK still runs as efficiently as ever.

View events in the Event Browser

The Event Browser has an event stream where you can see both valid and invalid events as they are sent by your game. Use this tool to confirm your integration and view errors and information about invalid events. Refer to Event Browser for more information.

Web debugging proxy tools

Charles Proxy or Fiddler are examples of utilities that can monitor network activity on your mobile device from your PC. When configured correctly, you can see individual network requests and responses as they're generated on your mobile device. This can be used to confirm that your game is sending events over the network to Analytics.

To monitor network activity using a network proxy:

  1. Install and configure Charles Proxy or Fiddler on your PC or Mac.
  2. Configure your Android or iOS mobile device to use your PC as a network proxy.
  3. Launch your game and monitor the network activity in Charles or Fiddler.

Enable logging in console

To view the debug messages about recording and uploading events in the Editor's console:

  1. Go to Project Settings > Player Settings > Player.
  2. Go to Script Compilation section > Scripting Define Symbols.
  3. Add keyword UNITY_ANALYTICS_EVENT_LOGS.
  4. Select Apply.

Note: It's advisable to disable logging before building for release.