---
title: "Android tagging"
slug: "android-tagging"
updated: 2026-06-09T21:50:50Z
published: 2026-06-09T21:50:50Z
canonical: "docs.xtremepush.com/android-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.

# Android tagging

Track your user's activity in your Android app

Xtremepush has two methods for tagging activity in your app, and with them it is possible to tag interactions and page impressions.

## Tagging interactions

To tag interactions call the `hitTag(String tag)` method of the `PushConnector` class where that interaction occurs. For example, to tag a button press:

```java
mPushConnector.hitTag("Checkout_Button_Pressed");
```

The `hitTag` method requires the `PushConnector` object you created when initialising XtremePush so if your app has a single base activity, you can create a public wrapper method to use it throughout your project , for example:

```java
public void sendTag(String tag){
    mPushConnector.hitTag(tag);
}
```

To tag interactions that capture a value and grab the value, the `hitTag` method takes an extra argument for data `hitTag(String tag, String data)`, for example to capture a form submission:

```java
mPushConnector.hitTag("form_1_field_1", "form_data");
```

## Page tagging for tracking page impressions

To tag page impressions call the `hitImpression(String impression)` method where your page loads:

```java
mPushConnector.hitImpression("your_impression_name");
```

The tag used to record a page impression should uniquely identify a page and it should be set programatically in apps with content that updates dynamically from a feed, for example:

```java
public void sendImpression(String impression){
    mPushConnector.hitImpression(impression);
}
```

## Setting user attributes

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

```java
// You can send any available attribute
mPushConnector.hitTag("user_attribute", ATTRIBUTE);
// like a users first name
mPushConnector.hitTag("first_name", "Joe");
// or their loyalty points balance
mPushConnector.hitTag("xp_points", "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 Main Activity:

### Tags batching

For batching of tags call `setTagsBatchingEnabled(true)` when initialising XtremePush:

```java
mPushConnector = new PushConnector.Builder("XTREME_PUSH_APP_KEY", "GOOGLE_PROJECT_NUMBER")
    .setTagsBatchingEnabled(true)
    .create(this);
```

### Impressions batching

For batching of impressions call `setImpressionsBatchingEnabled(true)` when initialising XtremePush:

```java
mPushConnector = new PushConnector.Builder("XTREME_PUSH_APP_KEY", "GOOGLE_PROJECT_NUMBER")
    .setImpressionsBatchingEnabled(true)
    .create(this);
```

Alternatively, batching for tags and impressions can be toggled during runtime as follows:

- For batching of tags call `mPushConnector.setTagsBatchingEnabled(true);`
- For batching of impressions call `mPushConnector.setTagsBatchingEnabled(true);`

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:

```java
mPushConnector.sendTags();
```

To manually release impressions:

```java
mPushConnector.sendImpressions();
```
