---
updatedAt: 2026-07-27T15:11:55.000Z
agentTools:
  siteIndex: https://documentation.bloomreach.com/llms.txt
  projectIndex: https://documentation.bloomreach.com/discovery/llms.txt
---

# iOS Application Pixel Integration

To set up Bloomreach pixels in your native iOS application, follow the steps below:

## 1. Add the SDK dependency package

The first step is to add the dependency package that contains the Bloomreach pixels for the iOS client library.\
To add the dependency, follow these steps:

1. Click on “Add Packages” from the File menu of Xcode.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/2f32173-image1.png",
        "image1.png",
        504
      ],
      "align": "center",
      "sizing": "30% ",
      "border": true
    }
  ]
}
[/block]

2. Paste the framework's GitHub URL in the search box: <https://github.com/bloomreach/discovery-ios-sdk>

![](https://files.readme.io/341cac6-image2.png "image2.png")

3. Click on `discovery-ios-sdk`, select the `main` branch, and add the package to the appropriate project.

![](https://files.readme.io/a73ffe3-image3.png "image3.png")

## 2. Initialization

To initialize the Discovery Pixel SDK in your app, first import the `discovery_ios_sdk` module in your **UIApplicationDelegate**:

```swift
import discovery_ios_sdk
```

Then initialize the Discovery SDK in your **app delegate's `application(_:didFinishLaunchingWithOptions:)` method** as shown:

```swift
class AppDelegate: NSObject, UIApplicationDelegate {
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    let brPixel = BrPixel(
        accountId: "<ACCOUND_ID>",
        uuid: “<13_digit_random_number>”,
        visitorType: VisitorType.NEW_USER,
        baseUrl: "http://app.bloomique.com/")

        PixelTracker.shared.intialise(brPixel: brPixel)       
    
        return true
  }
}
```

If you are using **SwiftUI**, use the `UIApplicationDelegateAdaptor` property wrapper to tell SwiftUI it should use your AppDelegate class for the application delegate.

```swift
@main
struct MyApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
```

*Make sure to replace all the placeholder values for the parameter values in the snippet above.*

> 📘 Note
>
> Create a synthetic base URL to track navigation in mobile apps. The synthetic URL could be a modified version of your website domain.
>
> For example, if your website is `https://www.bloomique.com`, your synthetic base URL could be `https://app.bloomique.com`.\
> For more granular tracking, use a structured format like `https://{app-version}-{platform}.app.{site}.com`. The path after the hostname can be anything, as long as you use it consistently.

Here is a reference of all the different parameters you can set based on your requirements:

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Description",
    "0-0": "accountId",
    "0-1": "Your Account ID provided by Bloomreach during integration",
    "1-0": "uuid",
    "1-1": "A 13 Digit random number.  \nEg: 2342698118212",
    "2-0": "visitorType",
    "2-1": "enum type for new or returning visitors",
    "3-0": "baseUrl",
    "3-1": "Synthetic base URL of your app. This represents the current page",
    "4-0": "domainKey  \n(Optional)",
    "4-1": "The Bloomreach-provided ID of the domain receiving the request",
    "5-0": "userId  \n(Optional)",
    "5-1": "Unique ID used to track the visitor. This parameter is only required if you track visitors via a universal customer ID",
    "6-0": "testData  \n(Optional)",
    "6-1": "Enter a Boolean value. Set test_data to `false` in the pixel for your prod release app",
    "7-0": "currency  \n(Optional)",
    "7-1": "Regional currency or currency used in the app",
    "8-0": "debugMode  \n(Optional)",
    "8-1": "Set this to `true` to get valuable debugging info and insights from the [Events Manager](https://documentation.bloomreach.com/discovery/docs/events-management) . By default, this is set to `false`",
    "9-0": "pixelUrlByRegion",
    "9-1": "URL for Pixel server based on region. Defaults to the _NA_ region",
    "10-0": "customerTier",
    "10-1": "Tier that the visitor belongs to. eg: Premium, Gold. For use with Relevance by Segment",
    "11-0": "customerCountry",
    "11-1": "Country that the visitor belongs to or is accessing the site from. For use with Relevance by Segment",
    "12-0": "customerGeo",
    "12-1": "Geography or Region that the visitor belongs to. For use with Relevance by Segment",
    "13-0": "customerProfile",
    "13-1": "Profile of the visitor. For use with Relevance by Segment",
    "14-0": "viewId  \n(Optional)",
    "14-1": "This parameter is only required if you are integrating on a site with multiple site versions with unique product catalog characteristics. Otherwise, viewId should not be declared in the pixel as this might cause issues with analytics.  \n  \nDuring your technical kickoff call, the Bloomreach integrations team will inform you whether viewId will be required for your pixel integration or not.  \n  \nThe value must be consistent with the view_id value passed in the feed and API calls."
  },
  "cols": 2,
  "rows": 15,
  "align": [
    "left",
    "left"
  ]
}
[/block]

> 📘
>
> The value of any of the above parameters can be modified later in the code, even after initialization. It can be done by using the following line:
>
> `PixelTracker.shared.brPixel.<FIELD_NAME> = <VALUE>`

## 3. Triggering Pixels

Refer to the following guides to Trigger specific pixels in your Android Application:

<ul>
<li><h3><a href="doc:triggering-page-view-pixels-ios">Page View Pixels</a></h3></li>
<li><h3><a href="doc:triggering-event-pixels-ios">Event Pixels</a></h3></li>
<li><h3><a href="doc:triggering-widget-pixels-ios">Widget Pixels</a></h3></li>

</ul>

## 4. Pixel validation

You can test the integration of the Pixel SDK using the Pixel validator built inside the SDK. No additional integration is needed.\
The Pixel validator only works in debug mode. The response from Pixel validation will be printed in Logs of xCode, as below:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/a3de9a7-image1.png",
        "image1.png",
        988
      ],
      "align": "center",
      "sizing": "80"
    }
  ]
}
[/block]