--- title: "Object Oriented Tracking" slug: "mapp-intelligence-ios-sdk-v5-object-oriented-tracking" updated: 2026-04-30T11:26:00Z published: 2026-04-30T11:26:00Z canonical: "docs.mapp.com/mapp-intelligence-ios-sdk-v5-object-oriented-tracking" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Object Oriented Tracking Object oriented tracking is the recommended approach for new iOS integrations and the successor to Query Parameter Tracking (Legacy). You build a typed event object (page view, action, media, form, …), optionally attach typed parameter objects (page, event, session, user, e‑commerce, campaign), and pass it to the matching `track…` method on `MappIntelligence.shared()`. Before you start, complete the [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) so the SDK is initialized. --- ## Why object oriented tracking - **Type safety:** the compiler checks that you set the right fields on the right event. - **Composability:** attach only the parameter objects you need — page parameters, e‑commerce data, user categories — without losing track of the request shape. - **Forward compatibility:** new parameters added to the SDK become new properties on the parameter classes, not new query‑string keys you have to remember. > [!NOTE] > **Note:** The iOS SDK does not provide implicit auto‑tracking of view controllers (unlike the Android SDK's activity / fragment auto‑tracking). You always trigger tracking explicitly from your app code — typically in `viewDidAppear` or a SwiftUI `onAppear`. --- ## Building blocks ### Tracking events | Event class | Use for | Page | | --- | --- | --- | | `MIPageViewEvent` | Page / screen views | [Pages](/v1/docs/mapp-intelligence-ios-sdk-v5-pages) | | `MIActionEvent` | User actions on a page | [Events](/v1/docs/mapp-intelligence-ios-sdk-v5-events) | | `MIMediaEvent` | Media playback (audio / video) | [Media Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-media-tracking) | | `MIFormSubmitEvent` / `formTracking(_:)` | Form interactions | [Form Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-form-tracking) | ### Parameter objects | Parameters class | Attach to | Page | | --- | --- | --- | | `MIPageParameters` | `MIPageViewEvent` | [Pages](/v1/docs/mapp-intelligence-ios-sdk-v5-pages) | | `MIEventParameters` | `MIActionEvent`, `MIMediaEvent` | [Events](/v1/docs/mapp-intelligence-ios-sdk-v5-events) | | `MISessionParameters` | Any event | [Sessions](/v1/docs/mapp-intelligence-ios-sdk-v5-sessions) | | `MIUserCategories` | Any event | [Users](/v1/docs/mapp-intelligence-ios-sdk-v5-users) | | `MIEcommerceParameters` + `MIProduct` | Any event | [Products and Orders](/v1/docs/mapp-intelligence-ios-sdk-v5-products-and-orders) | | `MICampaignParameters` | `MIPageViewEvent`, `MIActionEvent` | [Campaigns](/v1/docs/mapp-intelligence-ios-sdk-v5-campaigns) | | `MIMediaParameters` | `MIMediaEvent` | [Media Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-media-tracking) | | `MIFormParameters` + `MIFormField` | Form tracking | [Form Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-form-tracking) | --- ## Minimal example: track a page view **Swift** ```swift override func viewDidAppear(_ animated: Bool) {    super.viewDidAppear(animated)    let pageEvent = MIPageViewEvent(name: "Product Detail")    pageEvent.pageParameters = MIPageParameters(dictionary: [        1: "category-shoes",        2: "running"    ])    MappIntelligence.shared()?.trackPage(pageEvent) } ``` **Objective-C** ```objectivec - (void)viewDidAppear:(BOOL)animated {    [super viewDidAppear:animated];    MIPageViewEvent *pageEvent = [[MIPageViewEvent alloc] initWithName:@"Product Detail"];    pageEvent.pageParameters = [[MIPageParameters alloc] initWithDictionary:@{        @1: @"category-shoes",        @2: @"running"    }];    [[MappIntelligence shared] trackPage:pageEvent]; } ``` --- ## Where to go next - Track screens — [Pages](/v1/docs/mapp-intelligence-ios-sdk-v5-pages) - Track user actions — [Events](/v1/docs/mapp-intelligence-ios-sdk-v5-events) - Track commerce flows — [Products and Orders](/v1/docs/mapp-intelligence-ios-sdk-v5-products-and-orders) - Track media playback — [Media Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-media-tracking) - Track form interactions — [Form Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-form-tracking) --- ## Related - [Quickstart](/v1/docs/mapp-intelligence-ios-sdk-v5-quickstart) - [Default Parameters](/v1/docs/mapp-intelligence-ios-sdk-v5-default-parameters) - [Configure Global Tracking](/v1/docs/mapp-intelligence-ios-sdk-v5-configure-global-tracking) - [Query Parameter Tracking (Legacy)](/v1/docs/mapp-intelligence-ios-sdk-v5-query-parameter-tracking-legacy) — only if you forward parameters from an existing runtime layer that already produces query strings.