Query Parameter Tracking (Legacy)

Prev Next

The iOS SDK exposes two dictionary‑based tracking calls — trackCustomPage(_:trackingParams:) and trackCustomEvent(_:trackingParams:) — that take a flat string‑to‑string dictionary of parameter keys and values. They are the simplest way to send tracking data, but they bypass the type‑safe MI…Parameters objects.

When to use: only when you cannot use the typed event objects — for example, when you forward parameters from a runtime configuration system, a JavaScript bridge, or another untyped source. For new integrations, prefer Object Oriented Tracking.

Methods

Method

Description

trackCustomPage(_ pageName: String, trackingParams: [String: String]?)

Tracks a page view by name with a flat dictionary of tracking parameters.

trackCustomEvent(_ eventName: String, trackingParams: [String: String]?)

Tracks an action with a flat dictionary of tracking parameters.

Parameter keys

The keys in the dictionary follow the Mapp Intelligence query parameter convention: a numeric type plus the parameter index (for example cp1 for custom page parameter 1, ck1 for custom session parameter 1, cb1 for custom event parameter 1, oi for order ID).

The full list of supported keys is documented in the Mapp Intelligence pixel reference. The most common keys are:

Key

Maps to

cp1, cp2, …

Custom page parameter (analog to MIPageParameters.details)

cb1, cb2, …

Custom event parameter (analog to MIEventParameters.parameters)

ck1, ck2, …

Custom session parameter (analog to MISessionParameters.parameters)

uc1, uc2, …

User category (analog to MIUserCategories.customCategories)

cg1, cg2, …

Page group / category

Example: track a custom page

MappIntelligence.shared()?.trackCustomPage(
    "Product Detail",
    trackingParams: [
        "cp1": "category-shoes",
        "cp2": "running",
        "cg1": "shop"
    ]
)
[[MappIntelligence shared]
    trackCustomPage:@"Product Detail"
     trackingParams:@{
         @"cp1": @"category-shoes",
         @"cp2": @"running",
         @"cg1": @"shop"
     }];

Example: track a custom event

MappIntelligence.shared()?.trackCustomEvent(
    "AddToCart",
    trackingParams: [
        "cb1": "size-42",
        "cb2": "color-black"
    ]
)
[[MappIntelligence shared]
    trackCustomEvent:@"AddToCart"
      trackingParams:@{
          @"cb1": @"size-42",
          @"cb2": @"color-black"
      }];

Trade‑offs vs object oriented tracking

Aspect

Query parameter (this page)

Object oriented

Type safety

None — keys and values are strings.

Compiler‑checked properties on MI…Parameters classes.

Discoverability

Requires reading the pixel parameter reference.

Autocomplete in Xcode.

Use case

Forwarding parameters from runtime / scripting layers.

All native tracking in the app code.

Related: Object Oriented Tracking, Pages, Events.