googleAnalytics.* — Google Analytics

Type Library
Revision Release 2024.3703
Keywords analytics, Google Analytics, googleAnalytics
Platforms Android, iOS
Sample https://github.com/coronalabs/plugins-sample-googleAnalytics

Overview

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.

Registration

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

Syntax

local googleAnalytics = require( "plugin.googleAnalytics" )

Functions

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"
        },
    },      
}
Note

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

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

Support