> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/sdk/ios/data-privacy/data-collection.md).

# Automatic data collection

By default, the Batch SDK will automatically collect some data related to the user's device:

<table><thead><tr><th width="164.21875">Native data</th><th>Description</th><th width="224.3515625" align="right">Default collection status</th><th width="160.890625" data-type="checkbox">Installation based data model</th><th data-type="checkbox">Profile based data model</th></tr></thead><tbody><tr><td>Device Model</td><td>The user's device model information</td><td align="right">false</td><td>true</td><td>false</td></tr><tr><td>Installation ID</td><td>The installation identifier</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Session ID</td><td>The user's session identifier</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>Custom User ID</td><td>The user's custom identifier</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>API Level</td><td>The Batch SDK api level</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Messaging API Level</td><td>The Batch SDK Messaging api level</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Device Language</td><td>The user's device language</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Device Region</td><td>The user's device region</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Device Timezone</td><td>The user's device timezone</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>OS Version</td><td>The user's device iOS version</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>App Version (String)</td><td>The application version (string)</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>App Version (Build Number)</td><td>The application version (number)</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>Bundle Name</td><td>The application bundle identifier</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>Device Date</td><td>The current device date</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>Device Installation Date</td><td>The Batch installation date</td><td align="right">true</td><td>true</td><td>true</td></tr><tr><td>Bridge Version</td><td>Version of the batch bridge (for cross-platform plugin only)</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>Plugin Version</td><td>Version of the batch plugin (for cross-platform plugin only)</td><td align="right">true</td><td>true</td><td>false</td></tr><tr><td>GeoIP</td><td>Whether Batch should resolve the user's location from ip address.</td><td align="right">false</td><td>true</td><td>false</td></tr></tbody></table>

Some of this data are disabled by default and can be toggled on/off according to the user consent:

* Device model
* GeoIP

Use the following API to fine-tune what you want to enable:

{% tabs %}
{% tab title="Swift" %}

```swift
BatchSDK.updateAutomaticDataCollection { config in
    // Enable GeoIP resolution on server side
    config.setGeoIPEnabled(true)
    // Enable automatic collection of the device model information
    config.setDeviceModelEnabled(true)
}
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
[BatchSDK updateAutomaticDataCollection:^(BatchDataCollectionConfig * _Nonnull config) {
  // Enable GeoIP resolution on server side
  [config setGeoIPEnabled:true];
  // Enable automatic collection of the device model information
  [config setDeviceModelEnabled:true];
}];
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
This API can be used at any time in your application lifecycle and Batch will remember these values, even if your Application reboots.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.batch.com/developer/sdk/ios/data-privacy/data-collection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
