GoogleAnalytics

The Google Analytics Plugin lets you measure user interactions for your mobile and desktop apps. More...

Import Statement: import VPlayPlugins.googleanalytics 1.0

Properties

Methods

Detailed Description

The Google Analytics Plugin lets you measure user interactions for your mobile and desktop apps. It allows to track screen views and custom events to gain insights into your app's usage.

Property Documentation

anonymizeIp : bool

If you care about the privacy of your users you should tell Google Analytics to anonymize IP addresses from incoming requests. Enabling anonymize IP functionality tells Google Analytics to anonymize the IP information sent by the SDK by removing the last octet of the IP address prior to its storage.

The default value is false.


autoStartSession : bool

Sessions keep track of your user's timing behavior within your app, i.e. how long they are staying within your app. If you want to manually control the session start and stop events you can disable this property.

The default value is true.

See also startSession and stopSession.


propertyId : string

The tracking ID to use for this instance. It should be of the form `UA-xxxxx-y`. You can get your tracking ID from the Google Analytics Dashboard.


userId : string

Set this optional property to a known identifier for a specific user provided by your own backend. It may not itself be personally identifiable information but any other unique identifier to match your users across devices and platforms.


userLanguage : string

Set this proeprty to a 2-4 digit language code (like "en-us" or "en") to override the language reported to Google Analytics. If this property is not set the current system's default language will be used.

Note: You can find a list of language codes here.


Method Documentation

void addCustomDimension(int id, QString value)

Adds a custom dimension to your Google Analytics queries. Custom dimension IDs must be between 1 and 20. Unlike other types of data, custom dimensions are sent to Google Analytics as parameters attached to other hits, like pageviews or events. You can use custom dimensions to collect and analyze data that Google Analytics doesn't automatically track, like level completions or highscores. Before adding custom dimensions to your code, define them using the Google Analytics web interface.

Read more on custom dimensions and how to use them in the Google Analytics documentation.


void addCustomMetric(int id, QString value)

Adds a custom metric to your Google Analytics queries. Custom metrics IDs must be between 1 and 20. Unlike other types of data, custom metrics are sent to Google Analytics as parameters attached to other hits, like pageviews or events. You can use custom dimensions to collect and analyze data that Google Analytics doesn't automatically track, like level completions or highscores. Before adding custom metrics to your code, define them using the Google Analytics web interface.

Read more on custom metrics and how to use them in the Google Analytics documentation.


void logEvent(string eventCategory, string eventAction, string eventLabel, int value)

Events are a useful way to collect data about a user's interaction with interactive components of your app, like button presses or the use of a particular item in a game.

An event consists of four fields that you can use to describe a user's interaction with your app content:

  • eventCategory: A custom defined category for the event
  • eventAction: A custom defined action for the event
  • eventLabel: A custom defined category for the event, optional
  • value: A custom defined value for the event, optional

Note: If you provide a value it must be greater than 0.


void logScreen(string screenName)

Screens in Google Analytics represent content users are viewing within your app (like a pageview in web). Measuring screen views allows you to see which content is being viewed most by your users, and how are they are navigating between different pieces of content.

A screen view consists of a single string field called screenName that will be used as the screen name in your Google Analytics reports.


void removeCustomDimension(int id)

Removes the custom dimension with the given ID from your Google Analytics queries.


void removeCustomMetric(int id)

Removes the custom metric with the given ID from your Google Analytics queries.


void startSession()

Sessions keep track of your user's timing behavior within your app, i.e. how long they are staying within your app. Call this method if your set autoStartSession to false when you want to start the session tracking of your users.

See also stopSession.


void stopSession()

Sessions keep track of your user's timing behavior within your app, i.e. how long they are staying within your app. Call this method if your set autoStartSession to false when you want to stop the session tracking of your users.

See also startSession.


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support