google-analytics-4-property
Reactive icon

Google Analytics Library

Stable version 1.0.2 (Compatible with OutSystems 11)
Uploaded
 on 16 February 2024
 by 
4.2
 (5 ratings)
google-analytics-4-property

Google Analytics Library

Documentation
1.0.1

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:

  1. Go to the Google Analytics website.
  2. Sign in with your Google account.
  3. Click on "Admin" in the lower-left corner.
  4. In the "Account" column, select the account where you want to create the property.
  5. In the "Property" column, click on "Create Property."
  6. Choose the "Web" option for a website or select the relevant platform for your 


Step 2: Fill in Property Details:

  1. Enter a name for your property.
  2. Choose your reporting time zone and currency.
  3. Enter the business details and objectives


Step 3. Configure Data Streams:

  • After creating the property, set up a data stream to collect data.
  • Enter a stream name (usually the name of your website or app).
  • Choose the platform (web, iOS, Android) and follow the provided instructions to set up the stream.


How to use this library

This library has three actions that can be consumed:

  1. Init
  2. TrackScreen
  3. TrackEvent

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

Parameters

  1. Category: Google Analytics 4 event name.
  2. Properties: A name/value pairs object that contains data describing the event.
  3. Where to Call: On a client action where we need to track the action.

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!


1.0.0

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:

  1. Go to the Google Analytics website.
  2. Sign in with your Google account.
  3. Click on "Admin" in the lower-left corner.
  4. In the "Account" column, select the account where you want to create the property.
  5. In the "Property" column, click on "Create Property."
  6. Choose the "Web" option for a website or select the relevant platform for your 


Step 2: Fill in Property Details:

  1. Enter a name for your property.
  2. Choose your reporting time zone and currency.
  3. Enter the business details and objectives


Step 3. Configure Data Streams:

  • After creating the property, set up a data stream to collect data.
  • Enter a stream name (usually the name of your website or app).
  • Choose the platform (web, iOS, Android) and follow the provided instructions to set up the stream.


How to use this library

This library has three actions that can be consumed:

  1. Init
  2. TrackScreen
  3. TrackEvent

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

Parameters

  1. Category: Google Analytics 4 event name.
  2. Properties: A name/value pairs object that contains data describing the event.
  3. Where to Call: On a client action where we need to track the action.

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!