---
title: Manually track events - iOS
description: Learn how to track custom events in your iOS app using the CSQ SDK
lastUpdated: 05 January 2026
source_url:
  html: https://docs.contentsquare.com/en/csq-sdk-ios/product-analytics/track-events-manually/
  md: https://docs.contentsquare.com/en/csq-sdk-ios/product-analytics/track-events-manually/index.md
---

## Tracking custom events

In addition to autocaptured events, Product Analytics also supports manual tracking of custom events using `CSQ.trackEvent()` API.

* Swift

  ```swift
  CSQ.trackEvent("custom_event_name")
  ```

* Objective-C

  ```objective-c
  [CSQ trackEvent:@"custom_event_name"];
  ```

It doesn't matter what you call your event, there are ways in Product Analytics to cross-track events regardless of name. See our [guide on combo events ↗](https://help.heap.io/hc/en-us/articles/37271999013009-How-to-combine-events-using-a-combo-event) to learn more.

### Adding properties to custom events

Custom events can be enhanced with a set of properties that will correspond to the tracked event when passed into the `CSQ.trackEvent()` API call.

* Swift

  ```swift
  CSQ.trackEvent("custom_event_with_properties", properties: [
    "property1": "sample value",
    "property2": 10,
    "property3": false,
  ])
  ```

* Objective-C

  ```objective-c
  [CSQ trackEvent:@"custom_event_with_properties" properties:@{
    @"property1": @"sample value",
    @"property2": @10,
    @"property3": @NO
  }];
  ```

### Adding properties to all events

In some cases, you might want to add a property, or a collection of properties, to all events tracked by Product Analytics. Adding a global event property can be accomplished using `CSQ.addEventProperties()`.

* Swift

  ```swift
  CSQ.addEventProperties([
    "property1": "sample value",
    "property2": 10,
    "property3": false,
  ])
  ```

* Objective-C

  ```objective-c
  [CSQ addEventProperties:@{
    @"property1": @"sample value",
    @"property2": @10,
    @"property3": @NO
  }];
  ```

Properties that are added using the `CSQ.addEventProperties()` API will be attached to all events tracked by Product Analytics, including any events that are automatically tracked by a CSQ autocapture SDK.

## Removing a Property

Once a property is no longer needed in the global collection, use `CSQ.removeEventProperty()` to remove properties one at a time.

* Swift

  ```swift
  CSQ.removeEventProperty("property1")
  ```

* Objective-C

  ```objective-c
  [CSQ removeEventProperty:@"property1"];
  ```

## Removing All Properties

On the other hand, if you want to remove all properties added with `CSQ.addEventProperties()` at once, you can achieve this by using `CSQ.clearEventProperties()`.

* Swift

  ```swift
  CSQ.clearEventProperties()
  ```

* Objective-C

  ```objective-c
  [CSQ clearEventProperties];
  ```

However, neither of these methods will affect events that have already been processed.
