Requirements:
Google Tag ID: The plugin allows you to input your Google Analytics tracking ID to ensure the data is sent to the correct Google Analytics property. Check the link to view the instructions about How to Find your Google tag ID.
How to configure a GA4 property:
Step 1. Create a Google Analytics 4 Property:
Step 2: Fill in Property Details:
Step 3. Configure Data Streams:
How to use this library
This library has three actions that can be consumed:
Init
Parameters:
MeasurementId - is an identifier (e.g., G-12345) for a web data stream. You can use the Measurement ID to send data to a specific web data stream. You can get this value on the web stream detail page visible on the image of the config step.
Where to Call: Typically can be placed in the OnApplicationReady global event
Note: You can test if the config is working, by changing the stream URL for your current personal/development environment. Next, click on the option View tag instructions, select the tab Install manually, and on the option "Test your website (optional)" insert the URL for your app.
TrackScreen: Tracks a specific screen.
Where to Call: This action can be placed on the OnReady event on the screen to track or on a common layout used by the screens.
TrackEvent: Tracks a specific event.
Info: https://developers.google.com/tag-platform/devguides/events
In the following example, we will add an action to the Home screen associated with the "Add" button.
This action tracks an event that will be called "actions" and has two properties (the action name and the user).
View the data
After all this configuration and some application usage, all data will be available at the Google Analytics console. You can access the real-time report and confirm that the data is present!