Skip to content

Custom Tag Usage

The Unity SDK supports appending custom global tags at the SDK, RUM, and Log levels to supplement business context.

Usage

/// <summary>
/// Add custom global parameters. Applies to RUM and Log data.
/// </summary>
public static void AppendGlobalContext(Dictionary<string, object> property)

/// <summary>
/// Add custom RUM global parameters. Applies to RUM data.
/// </summary>
public static void AppendRUMGlobalContext(Dictionary<string, object> property)

/// <summary>
/// Add custom Log global parameters. Applies to Log data.
/// </summary>
public static void AppendLogGlobalContext(Dictionary<string, object> property)

Example

FTUnityBridge.AppendGlobalContext(new Dictionary<string, object>
{
    {"game_id", "unity-demo"},
    {"region", "cn"}
});

FTUnityBridge.AppendRUMGlobalContext(new Dictionary<string, object>
{
    {"scene", "main_menu"}
});

FTUnityBridge.AppendLogGlobalContext(new Dictionary<string, object>
{
    {"logger_source", "unity"}
});

Naming Suggestions

To avoid conflicts between custom fields and SDK fields, it is recommended to add a project abbreviation prefix to tag names, for example, df_tag_name. For detailed instructions, please refer to Application Access.