---
title: "iOS tagging"
slug: "ios-tagging"
updated: 2026-06-09T22:26:30Z
published: 2026-06-09T22:26:30Z
canonical: "docs.xtremepush.com/ios-tagging"
stale: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS tagging

Track your user's activity in your iOS app

Xtremepush has several methods for tagging activity in your app which allow you to tag page impressions, any other interactions for analytics, user attributes and realtime events to trigger in app messages if needed.

## Tagging interactions

To tag interactions for analytics and the ability to segment campaigns based on tag behaviour, call the `hitTag` method where that interaction occurs as shown:

**Swift**

```swift
// You might for example want to tag a button press
XPush.hitTag("Checkout_Button_Pressed")
```

**Objective-C**

```objectivec
// You might for example want to tag a button press
[XPush hitTag: @"Checkout_Button_Pressed"];
```

To tag interactions that capture a value and grab the value, use the `hitTag` method with the `withValue` option, for example:

**Swift**

```swift
// You might for example want to capture a form being filled out
XPush.hitTag("form_1_field_1", withValue: "form_data")
```

**Objective-C**

```objectivec
// You might for example want to capture a form being filled out
[XPush hitTag:@"form_1_field_1" withValue:@"form_data"];
```

## Page tagging for tracking page impressions

To tag page impressions call the `hitImpression` method where your page loads:

**Swift**

```swift
// Send impression to server to track page impressions
XPush.hitImpression("Page_Title")
```

**Objective-C**

```objectivec
// Send impression to server to track page impressions
[XPush hitImpression: @"Page_Title"];
```

The tag used to record a page impression should uniquely identify a page and it can be set programatically in apps with content that updates dynamically from a feed so that page impressions are crew.

## Setting user attributes

To associate custom [attributes](/documentation/docs/attributes-tags) against your user's profile you can use the following SDK method:

**Swift**

```swift
// You can send any available attribute
XPush.hitTag("user_attribute", withValue: ATTRIBUTE)
// like a users first name
XPush.hitTag("first_name", withValue: "Zoe")
// or their loyalty points balance
XPush.hitTag("xp_points", withValue: "500")
```

**Objective-C**

```objectivec
// You can send any available attribute
[XPush hitTag:@"user.attribute" withValue: ATTRIBUTE];
// like a users first name
[XPush hitTag:@"user.first_name" withValue: @"Zoe"];
// or their loyalty points balance
[XPush hitTag:@"user.xp_points" withValue: @"500"];
```

Attributes can be used in both for [segmentation](/documentation/docs/segmentation-user-info) and for [personalisation](/documentation/docs/dynamic-programmable-content).

## Batching of tags

The default behaviour for Tags is that they are sent immediately, if you want to control how chatty your app is you can enable batching.

To turn on batching you can call the following methods when initialising XtremePush in your AppDelegate:

### Tags batching

For batching of tags call:

**Swift**

```swift
XPush.tagsBatchingEnabled = true
```

**Objective-C**

```objectivec
[XPush setTagsBatchingEnabled:YES];
```

### Impressions batching

For batching of impressions call:

**Swift**

```swift
XPush.impressionsBatchingEnabled = true
```

**Objective-C**

```objectivec
[XPush setImpressionsBatchingEnabled:YES];
```

With batching turned on tags or impressions will be cached when you call *hitTag* or *hitImpression* and released when you exit your app or when you call the `sendTags` or `sendImpressions` methods, as shown below:

- To manually release tags:

**Swift**

```swift
XPush.sendTags()
```

**Objective-C**

```objectivec
[XPush sendTags];
```

- To manually release impressions:

**Swift**

```swift
XPush.sendImpressions()
```

**Objective-C**

```objectivec
[XPush sendImpressions];
```
