For a standard Web SDK implementation, you can use the following method:
1
braze.logCustomEvent("YOUR_EVENT_NAME");
If you’d like to use Google Tag Manager instead, you can use the Custom Event tag type to call the logCustomEvent method and send custom events to Braze, optionally including custom event properties. To do this:
Enter the Event Name by either using a variable or typing an event name.
Use the Add Row button to add event properties.
1
braze.logCustomEvent('YOUR_EVENT_NAME');
If you’ve integrated Infillion Beacons into your Android app, you can optionally use visit.getPlace() to log location-specific events. requestImmediateDataFlush verifies that your event will log even if your app is in the background.
When you log a custom event, you have the option to add metadata about that custom events by passing a properties object with the event. Properties are defined as key-value pairs. Keys are strings and values can be string, numeric, boolean, or Date objects.
To add metadata properties, use the following event-logging method.
TMap<FString,FString>Properties;Properties.Add(TEXT("you"),TEXT("can"));Properties.Add(TEXT("pass"),TEXT("false"));Properties.Add(TEXT("orNumbers"),FString::FromInt(42));Properties.Add(TEXT("orDates"),FDateTime::Now().ToString());Properties.Add(TEXT("or"),TEXT("any,array,here"));// Arrays are stored as comma-separated stringsProperties.Add(TEXT("andEven"),TEXT("deeply:nested,json"));UBraze->LogCustomEventWithProperties(TEXT("YOUR_EVENT_NAME"),Properties);
important:
The time and event_name keys are reserved and cannot be used as custom event properties.