React Native

🧠 Note: If you plan to send events from your application, please contact us in order to fully utilize this feature.

Inloco provides an analytics solution to measure which places users visit the most. App Events allow these metrics to be tied with any event defined by your application, so it can report, for example, which places your application is most used or where they commonly perform an in-app purchase.

App Events have two components: Event and Properties. The Event defines which action you wish to track and the properties contain information about the action, allowing more customization for the events that are being recorded. Properties are defined in key-value pairs.

🧙Tips: Some events are automatically recorded, so you don't need to define them or implement custom logic to track them. Refer to the last section of this article for more details.

📡Recording custom events

In the following example, a custom event is recorded whenever the user performs a download and the file size can be set through properties.

After you've initialized the SDK, you can log an event by using the method trackEvent, passing the event name and a mapping of properties, as shown on the snippet below:

InLocoEngage.trackEvent("file_download", {
"file_type": "png",
"file_size_mb": "5"

🧠Note: The properties parameter is optional; you can call trackEvent without including it. Passing an empty or null value to the eventName parameter, or a mapping of non-string key/values, does not send the event.

If the current location is relevant to the event, you can use the InLocoVisits.trackLocalizedEvent(); method. It works in the same way as trackEvent but tells the Inloco SDK to attach the current location to the event:

InLocoEngage.trackLocalizedEvent("user_started_transaction", {
"custom_key_1": "custom_value_1",
"custom_key_2": "custom_value_2"

🤖Automatically collected events

The following events can be automatically collected:

App Session

A session represents a single period of user interaction with your app. This information is automatically collected.

App Screen Session

A screen session represents a single period of user interaction with a specific Window (Activity or View Controller) inside the app.

It is initially disabled; to enable it, just modify the screenTrackingEnabled property on your Inloco options file.
InLocoOptions.plist (iOS)
InLocoOptions.plist (iOS)
<!-->Indicates whether the SDK is allowed to track the user's screen navigation. Default value: false<-->