---
updatedAt: 2026-04-29T09:43:30.000Z
---

# Reporting Pageviews Using React Native SDK

To report a page view to Dynamic Yield for every screen viewed on your native app, use one of the methods described in the following table. Select the appropriate method based on the page type.

> **Note:** If you have already called *chooseVariations* on a page with *isImplicitImpressionMode* set to *true*, **do not** report a page view. This would result in the same page view twice.

## Page types and reporting methods

[block:parameters]
{
  "data": {
    "h-0": "Page type",
    "h-1": "Unique attribute",
    "h-2": "Method",
    "0-0": "Homepage",
    "0-1": "\\--",
    "0-2": "[reportHomePageView](#reporthomepageview) ",
    "1-0": "Category",
    "1-1": "**Categories:** A full hierarchy of category names. Category names must be identical to the categories in the product feed, including capitalization.",
    "1-2": "[reportCategoryPageView](#reportcategorypageview) ",
    "2-0": "Product",
    "2-1": "**SKU:** A string of the main SKU in the page. Must match a SKU in the product feed.",
    "2-2": "[reportProductPageView](#reportproductpageview) ",
    "3-0": "Cart",
    "3-1": "**Cart:** A list of SKUs in the cart. Must match SKUs in the product feed.  \nIf the cart is empty pass an empty list.",
    "3-2": "[reportCartPageView](#reportcartpageview) ",
    "4-0": "Other",
    "4-1": "**Data:** A label to help identify other screen types. ",
    "4-2": "[reportOtherPageView](#reportotherpageview) "
  },
  "cols": 3,
  "rows": 5,
  "align": [
    "left",
    "left",
    "left"
  ]
}
[/block]

All methods include the following additional attributes:

* **pageLocation:** The name of the screen.
* **pageReferrer:** The name of the previous screen.
* **pageLocale:** The language version of a page that was displayed, such as en\_US. Use it only if you want to override the locale you previously set in the initialize method. Learn more about [using country codes for locale](https://dy.dev/docs/page-context#localization-in-page-context).

### reportHomePageView

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure Type",
    "0-0": "pageLocation <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required</strong></span>",
    "0-1": "String",
    "1-0": "pageReferrer",
    "1-1": "String? = nil",
    "2-0": "pageLocale",
    "2-1": "String? = nil"
  },
  "cols": 2,
  "rows": 3,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function chooseVariationsWithAllParameter() {
    await pageViews.reportHomePageView({
        pageLocation: 'screenName',
        pageReferrer: 'otherScreenName',
        pageLocale: 'en',
    }).then((result) => {
         switch (result.status) {
            case 'SUCCESS':
               //A pageview has been reported successfully
                break;
            case 'WARNING':
             result.warnings?.forEach(warning => {
                 // Log the warnings
             });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}v
```

### reportCategoryPageView

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

| Parameter                   | Data Structure Type |
| :-------------------------- | :------------------ |
| categories **(required)**   | \[String]           |
| pageLocation **(required)** | String              |
| pageReferrer                | String? = nil       |
| pageLocale                  | String? = nil       |

**Example**

```javascript React Native
async function reportCategoryPageView() {
    await pageViews.reportCategoryPageView({
        pageLocation: 'screenName',
        categories: ['category-1', 'category-2'],
        pageReferrer: 'otherScreenName',
        pageLocale: 'en',
    }).then((result) => {
         switch (result.status) {
            case 'SUCCESS':
               //A pageview has been reported successfully
                break;
            case 'WARNING':
             result.warnings?.forEach(warning => {
                 // Log the warnings
             });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}

```

### reportProductPageView

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure Type",
    "0-0": "sku <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "0-1": "String",
    "1-0": "pageLocation<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "1-1": "String",
    "2-0": "pageReferrer",
    "2-1": "String? = nil",
    "3-0": "pageLocale",
    "3-1": "String? = nil"
  },
  "cols": 2,
  "rows": 4,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportProductPageView() {
    await pageViews.reportProductPageView({
        pageLocation: 'screenName',
        sku: 'SKU123',
        pageReferrer: 'otherScreenName',
        pageLocale: 'en',
    }).then((result) => {
         switch (result.status) {
            case 'SUCCESS':
               //A pageview has been reported successfully
                break;
            case 'WARNING':
             result.warnings?.forEach(warning => {
                 // Log the warnings
             });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}
```

### reportCartPageView

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure Type",
    "0-0": "cart<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "0-1": "[String]",
    "1-0": "pageLocation<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "1-1": "String",
    "2-0": "pageReferrer",
    "2-1": "String? = nil",
    "3-0": "pageLocale",
    "3-1": "String? = ni"
  },
  "cols": 2,
  "rows": 4,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
 async function reportCartPageView() {
    await pageViews.reportCartPageView({
        pageLocation: 'screenName',
        cart: ['SKU123' , 'SKU456'],
        pageReferrer: 'otherScreenName',
        pageLocale: 'en',
    }).then((result) => {
         switch (result.status) {
            case 'SUCCESS':
               //A pageview has been reported successfully
                break;
            case 'WARNING':
             result.warnings?.forEach(warning => {
                 // Log the warnings
             });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}
```

### reportOtherPageView

Returns [DYResult](https://dy.dev/dy-dev/docs/swift-sdk-references#dyresult)

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Data Structure Type",
    "0-0": "data <br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "0-1": "String",
    "1-0": "pageLocation<br><span style=\"color:gray; font-size:0.8em;\"><strong>Required)</strong></span>",
    "1-1": "String",
    "2-0": "pageReferrer",
    "2-1": "String? = nil",
    "3-0": "pageLocale",
    "3-1": "String? = nil"
  },
  "cols": 2,
  "rows": 4,
  "align": [
    "left",
    "left"
  ]
}
[/block]

**Example**

```javascript React Native
async function reportOtherPageView() {
    await pageViews.reportOtherPageView({
        pageLocation: 'payScreen',
        data: 'any-information',
        pageReferrer: 'otherScreenName',
        pageLocale: 'en',
    }).then((result) => {
         switch (result.status) {
            case 'SUCCESS':
               //A pageview has been reported successfully
                break;
            case 'WARNING':
             result.warnings?.forEach(warning => {
                 // Log the warnings
             });
                break;
            case 'ERROR':
                const error = result.error
                //do something with the error
                break;
        }
    }).catch((error) => {
        //handle error
    });
}
```