iOS Analytics
Adjust tracking is configured automatically via the Alogame backend. No local setup required in the SDK.
Event names, their Adjust tokens, and the Adjust app token are managed by your game operator on the backend — you do not configure them in the app. As a developer you only call the logging APIs below with the event name agreed with your operator.
AdjustSigSdk — no manual setup needed
Adjust SDK v5 bundles AdjustSigSdk automatically. When integrating OegSdkV2 via SPM (source URL), Xcode resolves and embeds it as part of the normal build — no extra steps required.
If you see this crash:
dyld: Library not loaded: @rpath/AdjustSigSdk.framework/AdjustSigSdk
This means OegSdkV2 was added as a pre-built XCFramework (dragged in directly) rather than via SPM. Switch to SPM source integration:
File → Add Package Dependencies → enter your OegSdkV2 gitlab URL
Xcode will then resolve AdjustSigSdk automatically via the Adjust transitive dependency.
Do not add adjust_signature_sdk as a separate SPM dependency — it is already managed inside ios_sdk v5 and adding it separately causes version conflicts.
Auto-Tracked Events
The SDK automatically tracks the following lifecycle events when configured in the backend:
| Event Name | Description | Trigger |
|---|---|---|
sdk_show_login | Login screen displayed | User opens login UI |
sdk_register_success | Registration completed | User successfully registers |
sdk_login_success | Login completed | User successfully logs in (manual login only) |
sdk_logout | User logged out | User logs out or session expires |
sdk_recharge | In-app purchase completed | IAP verification succeeds |
These events are tracked automatically once your operator has set them up on the backend. No game code required.
Set Game Role
To enable role-specific tracking data (used in sdk_recharge and other events), call setGameRole() after the player enters the game:
import OegSdkV2
OegSdkCore.shared.setGameRole(
serverId: "server_01",
serverName: "Server 1", // optional
roleId: "character_123",
roleName: "DragonSlayer", // optional
level: 50 // optional
)
This information is used to enrich tracking events with player context. The SDK automatically clears this data on logout.
See also: Game Role API for detailed documentation and usage examples.
App Tracking Transparency (ATT)
ATT permission is only needed for IDFA access (accurate install attribution). Basic event tracking works without it — Adjust falls back to probabilistic attribution if permission is denied.
The SDK does not request ATT automatically. The game project is responsible for requesting permission at the right time.
Setup
1. Add to your game's Info.plist:
<key>NSUserTrackingUsageDescription</key>
<string>Cho phép theo dõi để cải thiện trải nghiệm trong game.</string>
2. Call at an appropriate moment in your UX (after onboarding, before showing ads — do not call at cold launch or Apple may reject):
import AppTrackingTransparency
ATTrackingManager.requestTrackingAuthorization { status in
// .authorized → IDFA accessible, full attribution
// .denied / .restricted → Adjust still works with probabilistic attribution
}
Uninstall Tracking
Uninstall tracking is automatic — no game code required. When APNs registers the device, the SDK forwards the raw APNs token (Data) directly to Adjust. Adjust then periodically sends a silent push; if delivery fails, the device is counted as an uninstall.
Requirements:
- Push Notifications capability enabled in Xcode (see Push Notifications)
OEGManager.handleDidRegisterForRemoteNotifications(deviceToken:)wired in AppDelegate- Adjust app token configured by your operator
Adjust requires the raw APNs Data token, not the FCM string token. The SDK handles this automatically — do not pass a hex string or FCM token to Adjust manually.
Deep Link Reattribution
Deep link reattribution is automatic. The SDK processes all incoming URLs through:
OEGManager.handleOpenURL(_:options:)— URL scheme callbacksOEGManager.handleContinueUserActivity(_:)— Universal Links
If these are already wired in your AppDelegate (required by the Installation guide), no additional code is needed. Install attribution (first open) works regardless — this is only needed to credit campaigns that bring back existing users.
Log an event
The SDK can log any event — there is no fixed list. An event is just a name plus optional string parameters. Which events exist, and how each name maps to an Adjust event token, is defined by your game operator (in Adjust + the Alogame backend); the SDK resolves the name to a token at runtime. You only need the event name agreed with your operator.
An event whose name has no token configured is silently skipped (no tracking, no error).
Swift
// Simple event, no parameters
OEGAnalytics.shared.logEvent("tutorial_complete")
// Event with custom parameters (all values are strings)
OEGAnalytics.shared.logEvent("level_up", parameters: [
"level": "10",
"score": "15000"
])
Objective-C
// Simple event, no parameters
[[OEGManager sharedManager] logEvent:@"tutorial_complete" withValues:nil];
// Event with custom parameters
[[OEGManager sharedManager] logEvent:@"level_up" withValues:@{
@"level": @"10",
@"score": @"15000"
}];
Log a revenue event
Events that carry money — Recharge (web_store / WebPay top-ups), first_recharge, or any custom revenue event — must set the real Adjust revenue with logRevenue. Sending the amount only as a plain parameter (e.g. charged_value) is not counted by Adjust — the dashboard would show 0.
The native StoreKit IAP flow fires sdk_recharge with revenue already set — no game code needed. Use logRevenue only for events the game pushes itself (web_store / WebPay recharges and custom revenue events).
The revenue is attached to the event's own token, so that event must be set up as a revenue event by your game operator. orderId deduplicates against double-counting.
Swift
OEGAnalytics.shared.logRevenue(
"Recharge", // event name set up as a revenue event by your operator
revenue: 99000, // real amount paid (must be > 0)
currency: "VND", // ISO 4217
orderId: "order_12345", // dedup id
parameters: ["payment_channel": "web_store", "product_id": "vip_pack_1"]
)
Objective-C
[[OEGManager sharedManager] logEvent:@"Recharge"
withValues:@{ @"payment_channel": @"web_store", @"product_id": @"vip_pack_1" }
revenue:99000
currency:@"VND"
orderId:@"order_12345"];
A recharge is a revenue event — always send it via
logRevenue(Swift) /logEvent:withValues:revenue:currency:orderId:(Objective-C), not the plainlogEvent, otherwise Adjust records no revenue.
Enable / disable tracking
Swift
OEGAnalytics.shared.setTrackingEnabled(false)
OEGAnalytics.shared.setTrackingEnabled(true)
Objective-C
[[OEGAnalytics shared] setTrackingEnabled:NO];
[[OEGAnalytics shared] setTrackingEnabled:YES];