---
title: addBreadcrumbs
slug: js-api/addbreadcrumbs
description: Overview of the Monetate JavaScript API addBreadcrumbs method and how to use it
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-04-29T15:34:30.245Z
---

:::CodeblockTabs
addBreadcrumbs Method

```javascript
// addBreadcrumbs Method
window.monetateQ.push([
  "addBreadcrumbs", ["string", "string", "string"]
]);
```
:::

You can use the `addBreadcrumbs` method to add a breadcrumb trail for a site visitor's navigation. This information allows you to see how the visitor arrived on their current page.&#x20;

:::hint{type="info"}
You can use the `addBreadcrumbs` method on all page types of your site.
:::

The method data is an ordered array of strings. Therefore, you should add each breadcrumb to the array in order.

:::hint{type="info"}
The `addBreadcrumbs` method and the [addCategories method](docId\:L1mhr-G5A0rK8Zc3l-_ur) have similar functionality, and you can them interchangeably.
:::

## Monetate Inspector View

This screenshot shows the **Components** tab of the [Monetate Inspector browser plug-in](https://docs.monetate.com/docs/install-the-monetate-inspector-browser-plug-in). The Breadcrumbs row indicates that the values passed by the addBreadcrumbs method are the pages visited in order.

![The Components tab of Monetate Inspector, with 'Home > Science > Animals' page breadcrumbs in the Breadcrumbs row](https://dyzz9obi78pm5.cloudfront.net/app/image/id/64f7712fbee50162c365772f/n/monetate-inspector-components-tab-event-viewpage-page-type-unknown-breadcrumbs-row.png)

This code example contains the method in use that results in the Monetate Inspector results shown in the previous screenshot.

:::CodeblockTabs
addBreadcrumbs Example

```javascript
// addBreadcrumbs Example
window.monetateQ = window.monetateQ || [];
window.monetateQ.push([
  "addBreadcrumbs", ["home", "science", "animals"]
]);
window.monetateQ.push([
  "trackData"
]);
```
:::

