---
schema_version: "1"
id: 70fc5b3227603bdc2cf804e3b3f49f48ef12d069d6a4d2ffdbaf36f49ddf174f
title: isactivedatacontext Element
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/guides/isml/b2c-isactivedatacontext.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/b2c-isactivedatacontext.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1183772d5e760eee057fc8ff13f970459e466d486ca827a138afea5bcc9a1692
products:
  - Composable Storefront
  - Salesforce APIs
---
# isactivedatacontext Element

Use to collect category context from a page for active data.

## Syntax

```
<isactivedatacontext
  category = current_category //required
/>
```

- category

  - : _Allowed data type:_ expression.

    `current_category` specifies the current category of the page being viewed by the customer. An expression that retrieves the current category from the pipeline dictionary is used.

## Purpose

This tag is used to specify the deepest (most specific) category being browsed on the page. If the tag appears multiple times in the same page, due to includes or other reasons, the category provided in the latest tag that appears in the HTML is the one that is counted.

The `<isactivedatacontext/>` tag must be placed somewhere within the `<head>` or `<body>` tags of each site page where `<script>` tags are valid.

It's best practice for this tag to be included in exactly one template used to make up each HTML page. If this tag appears in multiple templates used to make up a single HTML page, the latest template takes precedence. For example, if one tag indicates the "electronics" category, and a later tag indicates the "video" category, the "video" category takes precedence. There is no negative effect if the tag appears in multiple templates with the same category value for the same HTML page, but it's redundant. If this tag doesn't appear in any templates that are used to make up an HTML page, no category context is associated with the page.

## Example

In this example, the category context collected for the product being viewed is taken from the primary category of the product search result. See the `productsearchbreadcrumbs.isml` template in the SiteGenesis Storefront cartridge to see this example.

```
<isactivedatacontext category="${pdict.ProductSearchResult.category}" />
```
