# How to create a Tagging Plan?

The tagging plan lists the data you pass to Batch and the origin of each field. With a well-designed plan, you can segment users, personalize communications, and run impactful automations.

## **Step 1: Define Your Objectives**

Before sending any data, you must define clear goals. Every piece of data collected must be actionable and tied to a specific engagement scenario. The main objectives for collecting data in Batch are:

* [**Segmentation**](https://doc.batch.com/getting-started/features/customer-engagement-platform/orchestration/targeting): Targeting users based on the information available about them.
  * Example Use Case: Re-engaging customers who like a certain brand (`favorite_brands`) but haven't made a purchase recently (`last_purchase_date`).
* [**Personalization**](https://doc.batch.com/getting-started/features/customer-engagement-platform/message/personalization): Customizing the content of your communications by integrating user-specific information.
  * Example Use Case: Greeting a user by their `firstname` in an email.
* [**Triggering Automation**](https://doc.batch.com/getting-started/features/customer-engagement-platform/orchestration/trigger-automations): Launching automated workflows based on user events.
  * Example Use Case: Triggering an abandoned cart reminder via push if a user performs an `add_to_cart` event but does not follow up with a `validated_cart` event.

{% hint style="danger" %}
Do not simply replicate a tagging plan from another analytics tool (like Firebase). Analytics tagging serves a different purpose than a Customer Engagement Platform (CEP) like Batch. It is also not recommended to reuse a tagging plan from a previous similar tool, as it is essential to build the plan based on Batch's specific features and data model.
{% endhint %}

{% hint style="warning" %}
Read More:

* [How to automate birthday/anniversary wishes with a push notification](https://doc.batch.com/guides-and-best-practices/orchestration/how-to-automate-birthday-anniversary-wishes-with-a-push-notification).
* [How to implement thematic push opt-ins?](https://doc.batch.com/developer/technical-guides/how-to-guides/how-to-implement-thematic-push-opt-ins)
* [How can I reduce the abandoned cart rate with Batch?](https://doc.batch.com/guides-and-best-practices/~/changes/113/message/push-notifications/how-can-i-reduce-the-abandoned-cart-rate-with-batch)
  {% endhint %}

## **Step 2: Understand Batch's Data Types**

Batch organizes data into three main families:

### Native Data

User-centric data, automatically collected or calculated by the Batch SDK (e.g., country, language, push opt-in status, last visit date). You should not send a custom attribute for data that Batch already collects natively.

Read more: [What kind of data is collected via Batch SDKs by default?](https://doc.batch.com/getting-started/other/faq/what-kind-of-data-is-collected-via-batch-by-default)

### Custom Data

User-centric data you choose to send from your app, website, or backend via the [SDK](https://doc.batch.com/developer/sdk/ios/profile-data) or [API](https://doc.batch.com/developer/api/cep/profiles) to enrich user profiles. They can be of two types:

👉 [**Attributes**](https://doc.batch.com/developer/api/cep/profiles/update#the-attributes-object): A key-value pair that describes a user or installation, helping you qualify them (e.g., birthdate, user\_city, is\_premium).

👉 [**Events**](https://doc.batch.com/developer/api/cep/profiles/update#the-events-object): Actions a user performs at a specific time (e.g., `visited_page`, `added_to_cart`). Events natively include the date of the last occurrence and a counter tracking the total number of occurrences. They can also carry event attributes, expressed as key-value pairs or JSON objects.

### Catalogs Data

Non-user-centric data stored in collections that can be used directly within messages to power advanced personalization scenarios.

{% hint style="warning" %}
Refer to our dedicated documentation:

* [Catalogs API](https://doc.batch.com/getting-started/features/customer-engagement-platform/profiles/catalogs)
* [Referencing catalog data](https://doc.batch.com/getting-started/features/customer-engagement-platform/message/personalization#referencing-catalog-data)
  {% endhint %}

## **Step 3: Structure and Specify Your Custom Data**

These tables provide concrete examples of recommended attribute names and event structures that follow Batch’s tagging best practices.

### Attributes

<table><thead><tr><th width="86.609375">Type</th><th width="196.62890625">Convention</th><th width="209.5078125">Attribute name (example)</th><th width="252.3046875">Value (example)</th></tr></thead><tbody><tr><td><strong>String</strong></td><td>The attribute name</td><td>favorite_city</td><td>"Paris"</td></tr><tr><td><strong>Integer</strong></td><td>The attribute name prefixed by "nb_" or "count_"</td><td>nb_visits<br>count_items</td><td>4<br>18</td></tr><tr><td><strong>Float</strong></td><td>The attribute name</td><td>total_price<br>distance_km</td><td>135.79<br>4.0</td></tr><tr><td><strong>Boolean</strong></td><td>The attribute name prefixed by "is_" or "has_"</td><td>is_premium<br>has_children</td><td>true <br>false</td></tr><tr><td><strong>Date</strong></td><td>The attribute name prefixed by "date_"</td><td>date_signup</td><td>"2025-01-28T15:58:02+01Z"</td></tr><tr><td><strong>URL</strong></td><td>The attribute name prefixed by "url_"</td><td>url_page<br>url_homepage</td><td>"https://batch.com"  "myapp://path/to/homepage"</td></tr><tr><td><strong>Array</strong></td><td>The attribute name</td><td>thematic_optins</td><td>["tech", "sport", "music"]</td></tr><tr><td><strong>Object</strong></td><td>The attribute name</td><td>delivery_address</td><td><p></p><pre class="language-json"><code class="lang-json">{
      "number": 43,
      "street": "Rue Beaubourg",
      "zip_code": 75003,
      "city": "Paris",
      "country": "France"
}
</code></pre></td></tr></tbody></table>

### Events

<table><thead><tr><th width="196.4296875">Event name (example) </th><th width="117.6484375">Trigger</th><th width="225.7890625">Events attributes (example)</th><th>Event attributes type</th></tr></thead><tbody><tr><td><strong>validated_cart</strong></td><td>A user makes a purchase.</td><td><ul><li>item_list</li><li>delivery_address</li></ul></td><td><ul><li>Array</li><li>Object</li></ul></td></tr><tr><td><strong>visited_page</strong></td><td>A user visits a page.</td><td><ul><li>title </li><li>url_page</li><li>category </li><li>is_premium </li></ul></td><td><ul><li>String</li><li>URL</li><li>String</li><li>Boolean</li></ul></td></tr></tbody></table>

### **Technical Specifications**

👉 Please refer to our [APIs](https://doc.batch.com/developer/api/cep/profiles/update#native-attributes) and [SDKs](https://doc.batch.com/developer/sdk/ios/profile-data/attributes#managing-attributes) documentation for limitations.

### **Follow Best Practices**

To keep your tagging plan clean, maintainable, and effective, make sure to follow these naming best practices:

* Follow Naming Rules:
  * Use English and lowercase.
  * Use snake\_case, with underscores (\_) to separate words.
  * Use nouns for attributes and past-tense verbs for events.
* Ensure Data Consistency: Values must be sent in a consistent format and language across all sources (Mobile SDK, Web SDK, APIs)
* Aggregate Data: Consolidate similar events. For example, instead of tracking

  `visited_homepage`, `visited_settings` ... create a single `visited_page` event and use an event attribute `page_name` to store the page name.
* Don't Overdo It: Avoid collecting attributes or events that won't be used for your campaigns. Also, avoid excessive detail; focus on general, relevant data (e.g., track which page category a user visits, not every single click on a button).

{% hint style="success" %}
To ensure your data will work as expected, it's recommended to simulate the entire use case. From sending the data to creating the campaign in a demo dashboard, verify that the data can be used with the right operators to build your segment.
{% endhint %}

## **Step 4: Choose Your Data Source**

Data can be sent to Batch via the SDK, the Profile API or the Catalogs API.

* Use the [Profile API](https://doc.batch.com/developer/api/cep/profiles) for:
  * User-centric data ;
  * All data related to a logged-in user, whenever possible. This makes your backend the single source of truth.

{% hint style="danger" %}

* Our [Profile API](https://doc.batch.com/developer/api/cep/profiles/update) only works for identified users (with a Custom User ID).
* It's best to send updates in real-time as they occur. Avoid updating your entire user base at a fixed frequency (e.g., daily), as this can impact your [billing](https://doc.batch.com/getting-started/features/customer-engagement-platform/settings/plans-and-billing) and overload servers.
  {% endhint %}

- Use the [SDK](https://doc.batch.com/developer/sdk/ios/profile-data) for:
  * User-centric data
  * Data related to anonymous users.
  * Data tied to a specific device/installation.
  * Events that will trigger In-App messages. In-App messages can only be triggered by events coming from the SDK.

{% hint style="warning" %}
You can also use the SDK to send data related to a logged-in user.
{% endhint %}

* Use the [Catalogs API](https://doc.batch.com/developer/api/cep/catalogs) for:&#x20;
  * Non-user-centric data (e.g., product catalogs, media articles).

## **Step 5: Implement and Test Your Plan**

Once your plan is defined, your team can implement the data collection by following the technical documentation.

1. When a new data type is sent, it automatically appears in the Batch dashboard under the [Data management](https://doc.batch.com/getting-started/features/customer-engagement-platform/profiles/data-management) section.
2. From this screen, you must toggle the data on to make it available for use in your campaigns and automations. You can also rename it for display purposes.

The goal of testing is to verify that all data is being received correctly and that it supports all of your planned use cases.

{% hint style="warning" %}
Read More:

* [How to test the integration on Android?](https://doc.batch.com/developer/technical-guides/how-to-guides/mobile/android-specific/how-to-test-the-integration-on-android)
* [How to test the integration on iOS?](https://doc.batch.com/developer/technical-guides/how-to-guides/mobile/ios-specific/how-to-test-the-integration-on-ios)
* [How to test my Web Push integration?](https://doc.batch.com/developer/technical-guides/how-to-guides/web/how-to-test-my-web-push-integration)
  {% endhint %}

## **Step 6: Ensure** [**GDPR Compliance**](https://doc.batch.com/guides-and-best-practices/privacy-and-gdpr/gdpr-compliance)

As the Data Controller, you are responsible for ensuring that any data collection complies with regulations such as the GDPR, in particular:

* Data Minimization: Collect only the data that is strictly necessary for the purposes you have defined. Batch strongly advises against sending data that will not be used in the platform.
* Explicit Consent: The user must be clearly informed and give their consent via an explicit action before any data is collected. You can [integrate Batch with your Consent Management Platform](https://app.gitbook.com/o/yV0lmz43uUZMgWmM3297/s/CL8wF0y1T2vLnm3yR2MW/~/changes/351/technical-guides/how-to-guides/how-to-create-a-tagging-plan/~/comments/YvMe4YUziEmLDUPeELM3) (CMP) to manage this.
* Transparency: Your privacy policy must precisely describe what categories of data are collected, why they are collected, and how they are used.
