> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Data Layer Settings in the GraphQL Admin API

The GraphQL Admin API's data layer setting allows BigCommerce to send data from BigCommerce-hosted storefronts to third-party analytics providers through [Big Open Data Layer](/developer/docs/integrations/platform-solutions/analytics-with-bodl). BigCommerce can build native integrations to analytics providers, such as Google Analytics 4, using the data layer. Partners may also build their own integrations using the data layer. In each case, you must first enable the data layer using the GraphQL Admin API. The data layer is enabled at the global level.

This guide shows you how to use the GraphQL Admin API's data layer queries and mutations. For full schema, see the [GraphQL Admin API reference](/developer/api-reference/graphql/account/overview).

## Prerequisites

You need a [store-level API account](/developer/docs/overview/api-fundamentals/api-accounts#store-level-api-accounts) that contains the following [OAuth scopes](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes):

| UI Name                | Permission | Parameter              | Description                                    |
| :--------------------- | :--------- | :--------------------- | :--------------------------------------------- |
| Information & Settings | modify     | `store_v2_information` | View and modify store information and settings |

For more about API accounts that generate `access_token`s, see [API Accounts and OAuth Scopes](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts).

## Get data layer

Send the following query to retrieve whether the data layer is enabled in the store:

#### Request

**`Example query: Get data layer enabled flag`**

```http title="Example query: Get data layer enabled flag"
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

query {
  store {
    settings {
      dataSolutions {
        isDataLayerEnabled
      }
    }
  }
}
```

#### Response

**`Example query: Get data layer enabled flag`**

```json title="Example query: Get data layer enabled flag"
{
  "data": {
    "store": {
      "settings": {
        "dataSolutions": {
          "isDataLayerEnabled": false
        }
      }
    }
  }
}
```

## Enable data layer

Send the following mutation to enable the data layer in the store:

#### Request

**`Example mutation: Enable data layer`**

```http title="Example mutation: Enable data layer"
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

mutation {
  settings {
    dataSolutions {
      updateDataLayer (input: {isDataLayerEnabled: true}) {
        dataSolutions {
          isDataLayerEnabled
        }
      }
    }
  }
}
```

#### Response

**`Example mutation: Enable data layer`**

```json title="Example mutation: Enable data layer"
{
  "data": {
    "settings": {
      "dataSolutions": {
        "updateDataLayer": {
          "dataSolutions": {
            "isDataLayerEnabled": true
          }
        }
      }
    }
  }
}
```

## Disable data layer

Send the following mutation to disable the data layer in the store:

#### Request

**`Example mutation: Disable data layer`**

```http title="Example mutation: Disable data layer"
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json

mutation {
  settings {
    dataSolutions {
      updateDataLayer (input: {isDataLayerEnabled: false}) {
        dataSolutions {
          isDataLayerEnabled
        }
      }
    }
  }
}
```

#### Response

**`Example mutation: Disable data layer`**

```json title="Example mutation: Disable data layer"
{
  "data": {
    "settings": {
      "dataSolutions": {
        "updateDataLayer": {
          "dataSolutions": {
            "isDataLayerEnabled": false
          }
        }
      }
    }
  }
}
```

## Resources

* [GraphQL Admin API reference](/developer/api-reference/graphql/account/overview)
* [Big Open Data Layer](/developer/docs/integrations/platform-solutions/analytics-with-bodl)