Event Tracking
Record defined user interactions in your Android app with a single SDK call.
Overview
The Sees360 Android SDK provides the track method for recording defined user interactions within an application.
Tracking events can be used for actions such as:
- Clicking a button
- Opening a displayed deal
- Interacting with promotional content
- Other application-specific user actions
Each tracking event is registered against a project in Sees360 before it is used in the application.
Registering a tracking event
Tracking events are created in the Sees360 web application. Open the Tracking Events section for the required project and enter a short description of the action you want to track, for example Compare button clicked.
Sees360 automatically generates the event identifier user_compare_button_clicked, and the Tracking Events page displays the corresponding SDK call:
Sees360.track("user_compare_button_clicked")
Tracking an event
Once an event has been registered, call Sees360.track when the relevant user interaction occurs:
Sees360.track("user_compare_button_clicked")
For example:
compareButton.setOnClickListener {
Sees360.track("user_compare_button_clicked")
openComparison()
}
The slug passed to track must match the identifier registered for the project.
Classic Android views
For a standard Android view:
val compareButton: Button = findViewById(R.id.compareButton)
compareButton.setOnClickListener {
Sees360.track("user_compare_button_clicked")
openComparison()
}
Jetpack Compose
track can be called directly from a Compose interaction:
Button(
onClick = {
Sees360.track("user_compare_button_clicked")
openComparison()
}
) {
Text("Compare")
}
No additional Compose integration is required for tracking events.
WebView tracking
Tracking events can also be triggered from JavaScript running within an Android WebView.
First attach the Sees360 JavaScript bridge to the WebView:
Sees360.attachJavascriptBridge(webView)
For example:
val webView: WebView = findViewById(R.id.webView)
webView.settings.javaScriptEnabled = true
Sees360.attachJavascriptBridge(webView)
webView.loadUrl("https://example.com")
JavaScript running in the WebView can then call:
Sees360.track("user_compare_button_clicked");
This allows web-based areas of an application to use the same registered tracking events as native Android code.
Only attach the JavaScript bridge to WebViews containing content that the application trusts.
Registered events
The Sees360 API only accepts tracking events that have been registered against the current project.
For example, if the project contains user_compare_button_clicked, then Sees360.track("user_compare_button_clicked") can be recorded. An arbitrary event such as Sees360.track("user_something_not_registered") will not be accepted by the Sees360 API.
Developers should therefore use the event identifier displayed on the project’s Tracking Events page.
Enabling and disabling events
Tracking events can be enabled or disabled from the Sees360 web application.
An enabled event can be received and recorded normally. If an event is disabled, calls using that event identifier will no longer be accepted by the Sees360 API. This allows an event to be retired without requiring its definition to be deleted.
Analytics consent
Tracking events respect the SDK’s analytics consent setting. Consent can be enabled and disabled with:
Sees360.sharedInstance().setAnalyticsConsent(true)
Sees360.sharedInstance().setAnalyticsConsent(false)
When analytics consent is disabled, calls to track are ignored and the event is not added to the tracking queue. Applications should apply their stored analytics-consent choice after initializing the SDK.
See Analytics Consent for the full opt-in/opt-out flow, including persisting and reapplying the user’s choice.
SDK initialization
The SDK must be initialized before track is called:
Sees360.initialize(
applicationContext,
apiKey = BuildConfig.API_KEY,
identifier = identifier
)
Calling track before the SDK has been initialized will result in an error. The SDK also requires its probe to have completed registration before tracking events can be accepted — application developers do not normally need to manage probe registration directly, as it is handled as part of SDK initialization.
Event delivery
When a valid registered event is tracked, the SDK handles delivery to Sees360. A tracking request contains the registered slug:
{
"tracking_event": {
"slug": "user_compare_button_clicked"
}
}
On receipt, Sees360 verifies that the event:
- Belongs to the project
- Is registered
- Is currently enabled
If accepted, it is recorded as an analytics event using the tracking-event slug as the event name (e.g., user_compare_button_clicked). No custom event payload is required.
No custom payload
The tracking API intentionally accepts only the registered event identifier:
Sees360.track("user_compare_button_clicked")
Developers do not need to provide arbitrary event data such as labels, URLs, IDs, or custom payloads. This keeps the definition of each event consistent between applications and platforms.
track vs. screen-view tracking
track is used for defined user interactions. Screen views are handled separately by the SDK’s screen-view tracking functionality, for example:
- User views Compare Deals screen: screen-view tracking
- User presses Compare:
Sees360.track("user_compare_button_clicked")
Refer to Screen-View Tracking (Activities & Fragments) and Screen-View Tracking (Jetpack Compose) for information about screen tracking.
Recommended workflow
The recommended workflow is:
- Decide which application interaction should be measured.
- Register the interaction from the project’s Tracking Events page in Sees360.
- Enter a short human-readable description, such as
Compare button clicked. - Sees360 generates an identifier:
user_compare_button_clicked. - Copy the generated SDK call:
Sees360.track("user_compare_button_clicked"). - Add the call at the point where the interaction occurs.
- Ensure the tracking event remains enabled in Sees360.
This keeps tracking-event definitions controlled centrally while keeping the application integration intentionally simple.