googleAnalytics.* — Google Analytics

Type Library
Revision Release 2021.3646
Keywords analytics, Google Analytics, googleAnalytics
Platforms Android, iOS


The Google Analytics plugin lets you measure the value of your app across all stages, discover what keeps users engaged, and learn how to make your app more successful.

This documentation outlines the legacy Google Analytics plugin for mobile apps using non-Firebase Google Analytic. For new apps, you should use Google Analytics v2 plugin.


Before implementing the Google Analytics plugin, you must register for Google Analytics and obtain the tracking ID for your account.


local googleAnalytics = require( "plugin.googleAnalytics" )


Project Settings

To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.

settings =
    plugins =
        ["plugin.googleAnalytics"] =
            publisherId = "com.coronalabs"

For Android, the following permissions/features are automatically added when using this plugin:

  • "android.permission.INTERNET"
  • "android.permission.ACCESS_NETWORK_STATE"