How to configure a GA4 property
Create a new GA4 property
To create a new property you need to have access to Google Analytics Console (https://analytics.google.com/).
1. Enter the Admin screen
2. Click on "Create Property"
3. Fill the required fields
4. Select platform Web, enter the App URL and select a Stream name
5. Check the newly created stream details, and save the Measurement ID to use in the Google Analytics Reactive Component
Migrate an already existent UA (Universal Analytics) property to GA4
To migrate a property you need to have access to Google Analytics Console.
This process will create a new GA4 property and connect it to an already existing one.
1. Enter the Admin screen, with the existent UA property selected in the dropdown and click on GA4 Setup Assistant
2. Click on "Get Started" button and then on "Create Property" to create the GA4 property and Data Stream
3. To see the created GA4 property click on "See your GA4 property" button
4. The created stream will be available under the Data Streams section. Click on the created Data Stream to see its details.
How To Use
The Google Analytics Reactive component allows an application to track screen visits and custom events in both Mobile and Reactive applications using Google Analytics services.
There are three client actions available:
Before using this component you must have a valid Google account, and a Measuring ID for each app. These can be managed at the Admin console of Google Analytics.
Init
The Init client action loads and initializes the Google Analytics required scripts.
These should be initialized early so it's recommended to add it to the OnApplcationReady system event. This action must receive the Google Analytics account MeasuringId (G-XXXXXXXXXX) as an input parameter. This is available on Google Analytics console at https://analytics.google.com/ through the Admin screen, and in the Data Streams section.
Track event
The TrackEvent client action is used to track a custom event. This event is usually connected with some sort of action such as playing a video or clicking a button.
To track a custom event just add the TrackEvent to a given client action. As input parameters this action receives an event name and an optional list of custom event parameters (key/value pairs).
These parameters are chosen by the developer, and will help filtering data in the Analytics Console.
In the following example, the application is tracking whether a user plays a specific video, so the TrackEvent was added to the action that plays the video.
After all this configuration and some application usage, all data will be available at the Google Analytics Console.