Google Analytics Measurement Protocol 1.2.2
Google Analytics plugin for Unreal Engine, using a native cross-platform implementation of the Measurement Protocol.
|
Google Analytics Measurement Protocol static methods that can be called from both Blueprint and C++. More...
#include <GAMPStatics.h>
Static Public Member Functions | |
static class UGoogleAnalyticsMPAttributesFilter * | GetAttributesFilter () |
Get the Attributes Filter instantiated internally (. More... | |
Session handling | |
static void | StartSession (const TMap< FString, FString > &Attributes) |
Start a user session. More... | |
static void | EndSession (const TMap< FString, FString > &Attributes) |
Ends a user session. More... | |
static void | ResetPersistentData () |
Reset any persistent and cached data. More... | |
static void | SetOptOut (bool bOptOut) |
Set if "opt-out" from all analytics logging. More... | |
static bool | GetOptOut () |
Get the status of the "opt out" option. More... | |
static void | SetUserID (const FString &UserID) |
Set the know unique identifier of the current user. More... | |
Batching | |
static void | BeginBatch () |
Begin a batch of events, optimizing their sending when explicitly ending the batch. More... | |
static void | EndBatch () |
End a batch of events, sending the batched events. More... | |
Events logging | |
static void | RecordNamedEvent (const FString &EventName, const TMap< FString, FString > &Attributes) |
Records a named "event". More... | |
static void | RecordScreenView (const FString &ScreenName, const TMap< FString, FString > &Attributes) |
Records a "screenview" hit type to log how the user is moving inside your game/application. More... | |
static void | RecordStructuredEvent (const FString &EventCategory, const FString &EventAction, const FString &EventLabel, const int32 EventValue, const TMap< FString, FString > &Attributes) |
Records an "event" hit type [deprecated, UA only]. More... | |
static void | RecordStructuredEventWithValue (const FString &EventCategory, const FString &EventAction, const FString &EventLabel, const int32 EventValue, const TMap< FString, FString > &Attributes) |
Records an "event" hit type (with an associated value) [deprecated, UA only]. More... | |
static void | RecordStructuredEvent (const FString &EventCategory, const FString &EventAction, const FString &EventLabel, const TMap< FString, FString > &Attributes) |
Records an "event" hit type [deprecated, UA only]. More... | |
E-commerce | |
static void | RecordECommerceViewProduct (const FGoogleAnalyticsMPPurchaseInfo &PurchaseInfo) |
Record the view of a purchasable product (with real money), before starting the checkout action. More... | |
static void | RecordECommerceBeginCheckout (const FGoogleAnalyticsMPPurchaseInfo &PurchaseInfo) |
Record the add-to-cart/checkout of a purchase (with real money), before completing the purchase. More... | |
static void | RecordECommercePurchase (const FGoogleAnalyticsMPPurchaseInfo &PurchaseInfo) |
Record the completion of a purchase (with real money). More... | |
Friends | |
class | IGoogleAnalyticsMPProvider |
Google Analytics Measurement Protocol static methods that can be called from both Blueprint and C++.
This class provides the plugin API, including methods for ordinary event logging and methods to manage advanced features like session handling, opt-out, cached storage, etc.
|
static |
Begin a batch of events, optimizing their sending when explicitly ending the batch.
You MUST call EndBatch(). Calls can be nested, as long as they're correctly paired.
|
static |
End a batch of events, sending the batched events.
In general, the top-level EndBatch() call is the one that will ensure that all the batched events are sent.
|
static |
Ends a user session.
If UGoogleAnalyticsMPSettings::bAutoSessionHandling is false, you must call this method when your application ends.
|
static |
Get the Attributes Filter instantiated internally (.
|
static |
Get the status of the "opt out" option.
|
static |
Record the add-to-cart/checkout of a purchase (with real money), before completing the purchase.
PurchaseInfo | The information about items for which the user has started the checkout process. |
RecordECommerceViewProduct() MUST be called before this one. If the purchase is confirmed/completed, a call to RecordECommercePurchase() MUST be done.
|
static |
Record the completion of a purchase (with real money).
PurchaseInfo | The purchase information about the transaction. |
RecordECommerceBeginCheckout() MUST be called before this one.
|
static |
Record the view of a purchasable product (with real money), before starting the checkout action.
PurchaseInfo | The information about the item(s) the user is currently seeing. |
This is the first method that MUST be called in a purchase journey. If the user proceed with the purchase, a call to RecordECommerceBeginCheckout() MUST be done.
|
static |
Records a named "event".
EventName | Event name. Attention: GA4 has strict naming rules and reserved event names (read more), we suggest to use a unique common safe prefix for custom events. |
Attributes | Optional auxiliary Google Analytics Measurement Protocol attributes (for GA4 see https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag; for UA see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters). |
|
static |
Records a "screenview" hit type to log how the user is moving inside your game/application.
In Unreal Engine, you can use it to track the user navigation between menus and maps.
ScreenName | The screen name as logged in Google Analytics. |
Attributes | Optional auxiliary Google Analytics Measurement Protocol attributes (for GA4 see https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag; for UA see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters). |
|
inlinestatic |
Records an "event" hit type [deprecated, UA only].
Events are user interactions with content other than screen views.
Read more about Google Analytics events here: https://support.google.com/analytics/answer/1033068?hl=en. To add further custom data to events, read about the Custom Dimensions and Metrics: https://support.google.com/analytics/answer/2709828?hl=en.
If you must log an event with a numeric value associated, you can use RecordStructuredEventWithValue().
EventCategory | Event category (required, it must not be empty). |
EventAction | Event action (required, it must not be empty). |
EventLabel | Event label (optional, can be empty). |
EventValue | Event value (required, use the other RecordEvent* methods if the value must not be logged). |
Attributes | Optional auxiliary Google Analytics Measurement Protocol attributes (for GA4 see https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag; for UA see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters). |
|
inlinestatic |
Records an "event" hit type [deprecated, UA only].
Events are user interactions with content other than screen views.
Read more about Google Analytics events here: https://support.google.com/analytics/answer/1033068?hl=en.
EventCategory | Event category (required, it must not be empty). |
EventAction | Event action (required, it must not be empty). |
EventLabel | Event label (optional, can be empty). |
Attributes | Optional auxiliary Google Analytics Measurement Protocol attributes (for GA4 see https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag; for UA see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters). |
|
inlinestatic |
Records an "event" hit type (with an associated value) [deprecated, UA only].
Events are user interactions with content other than screen views.
Read more about Google Analytics events here: https://support.google.com/analytics/answer/1033068?hl=en. To add further custom data to events, read about the Custom Dimensions and Metrics: https://support.google.com/analytics/answer/2709828?hl=en.
EventCategory | Event category (required, it must not be empty). |
EventAction | Event action (required, it must not be empty). |
EventLabel | Event label (optional, can be empty). |
EventValue | Event value (required, use the other RecordEvent* methods if the value must not be logged). |
Attributes | Optional auxiliary Google Analytics Measurement Protocol attributes (for GA4 see https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag; for UA see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters). |
|
static |
Reset any persistent and cached data.
Call this method to remove any stored data and reset the system to a clean and fresh state. This includes resetting the "opt-out" option (see SetOptOut()), any cached User ID and Client ID, etc.
|
static |
Set if "opt-out" from all analytics logging.
This is a "kill switch" method that can be used to silently ignore all calls made to log events on Google Analytics. It's useful if you want to provide to the user a simple option to opt-out from the analytics. The value is saved in the persistent storage. The default initial value is set in the project settings (see UGoogleAnalyticsMPSettings::bOptOutDefault).
bOptOut | Set to true to stop sending data to Google Analytics. |
|
static |
Set the know unique identifier of the current user.
The value is saved in the persistent storage accordingly to the setting UGoogleAnalyticsMPSettings::bPersistentUserID.
UserID | The known identifier for a user, or an empty string to clear it. It must not itself be PII (Personally Identifiable Information). If you have only PII (e.g. the user email address), we suggest to pass a proper hash string of it. |
|
static |
Start a user session.
If UGoogleAnalyticsMPSettings::bAutoSessionHandling is false, you must call this method when your application starts.