-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Description
Hello,
I wanted to confirm if this is the correct way to send event scoped dimensions ?
tracker = MatomoTracker(siteId: "23",
baseURL: URL(string: "https://your-matomo.example/matomo.php")!)
// Optional: VISIT-level dimension (applies to all hits after you set it)
// (Only if your SDK version exposes this API)
// tracker.set(value: "paid_user", forIndex: 1)
// EVENT-level custom dimension(s): attach only to THIS event
let eventDims: [CustomDimension] = [
CustomDimension(id: 3, value: "black_friday"), // Event-scope dimension #3
CustomDimension(id: 4, value: "cta_primary") // Event-scope dimension #4
]
let event = Event(
tracker: tracker,
action: ["shop", "pricing"], // action_name path
url: URL(string: "myapp://shop/pricing"),
eventCategory: "ui",
eventAction: "tap",
eventName: "upgrade_button",
eventValue: nil,
customTrackingParameters: [
// Any extra Tracking API params that aren’t first-class properties
"pv_id": UUID().uuidString
],
dimensions: eventDims,
variables: [],
isCustomAction: false
)
tracker.track(event)
Metadata
Metadata
Assignees
Labels
No labels