This document describes how to debug and troubleshoot the Google Analytics Plugin for Unity.
Debugging & Troubleshooting
If you've followed the Developer's Guide but are not seeing any data in Google Analytics reports, review the following suggestions and considerations:
- It can take up to 24 to 48 hours for Google Analytics to start reporting data. If you've confirmed that your implementation is correct then wait at least 48 hours to determine if this delay is the reason you're not seeing any data.
- Real-Time reporting allows you to monitor activity as it happens on your site or app. This can be used to quickly confirm that hits are arriving. Note that Real-Time reporting is sometimes temporarily suspended in views that you haven't recently accessed, however Real-Time is reactivated after you visit a Real-Time report in that view. For more details, view the About Real-Time help article.
- Set the log level to
VERBOSE
to get additional information about missing parameters or other issues which could be preventing your hits from being sent. Click on GAv4 in the game hierarchy and then select the log level in the drop down.
- Confirm that you have correctly configured the prefab. It is important that you have the correct Property/Tracking ID and an App Name. Make sure you're looking at reports for the corresponding property.
- Confirm that you've set the dispatch period to a reasonable value. Setting this to zero or a negative value will completely stop dispatching hits, while a large value will prevent hits from showing up in the Real-Time reports (they will still be viewable in the other reports). The default value for the plugin is 5 seconds.
- On Android devices with Google Play Services installed, auto dispatching is enabled and manual dispatching is not available. Consult the Android Dispatch document for additional details.
- Confirm that the Dry Run flag is unchecked. This flag is intended for testing your game and if checked it will prevent all hits from being sent to Google Analytics.
For general configuration and build issues, consult the following:
- Before using
GoogleAnalyticsV4
in your scripts, ensure that the prefab is configured and in the object hierarchy. Otherwise aNullReferenceException
may appear. - If you are getting linker errors when building for iOS then follow the iOS setup and configuration steps to automatically add the required libraries when building.
- If you are getting permissions errors on Android then follow the Android setup and configuration steps to learn how to update your AndroidManifest.xml file.
Additional resources
If you are still having issues and are unable to troubleshoot the issue you can try the following:
- Ask for help on Stack Overflow: google-analytics.
- Open an issue if you think there is a bug in the plugin.