Created on 20 December 2019
icon_unfollowing
Login to follow
google-analytics-reactive

Google Analytics Reactive

Stable version 2.0.0 (Compatible with OutSystems 11)
Uploaded on 09 June 2022 by 
google-analytics-reactive

Google Analytics Reactive

Documentation
2.0.0

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.


  1. Enter the Admin screen


  1. Click on ‘Create Property’


  1. Fill the required fields



  1. Select platform Web, enter the App URL and select a Stream name



  1. 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


  1. Click on ‘Get Started’ button and then on ‘Create Property’ to create the GA4 property and Data Stream



  1. To see the created GA4 property click on ‘See your GA4 property’ button


  1. The created stream will be available under the Data Streams section. Click on the created Data Stream to see its details.


  1. Check the newly created stream details, and save the Measurement ID to use in the Google Analytics Reactive Component


 

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 two client actions available:

  • Init

  • TrackEvent

 

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.


1.0.0

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:

  • Init
  • TrackEvent
  • TrackScreen


Before using this component you must have a valid Google account,  and a TrackingId 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 TrackingId as an input parameter. This is available on Google Analytics console at https://analytics.google.com/ 




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. This action receives four input parameters:

table from https://developers.google.com/analytics/devguides/collection/analyticsjs/events 

On 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.

For more information about custom events:

https://developers.google.com/analytics/devguides/collection/analyticsjs/events 



Track screen

The TrackScreen client action is used to track screen visits. All that's needed to achieve this is to add this action to the OnReady event action of the layouts you want to track, or of any specific screen.



After all this configuration on the application, all data will be available at the Google Analytics console.


Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
Google Analytics Reactive has no dependencies.