---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/metrics](../index.md) / parseSeriesTags

# Function: parseSeriesTags()

> **parseSeriesTags**(`params`): [`MetricSeriesTags`](../type-aliases/MetricSeriesTags.md)

Defined in: [packages/b2c-tooling-sdk/src/operations/metrics/tags.ts:247](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/operations/metrics/tags.ts#L247)

Extracts the dimension tags for a single series id.

Combines three tiers, most-authoritative last:
1. **Request identity** — `realm`/`environment` from the tenant id (never parsed
   from the series string).
2. **String heuristics** — category/metric-specific dimensions parsed from the
   packed id (`apiFamily`, `host`, `cacheStatus`, …), or the raw remainder under
   `series` when no rule matches.
3. **Applied filters** — any filter that was sent with the request
   ([MetricsTagContext](../interfaces/MetricsTagContext.md)) is stamped last, overriding a heuristic guess.
   This corrects drill-down ids: with `apiFamily=shopper` the server returns
   `bdpx.shopper.auth.v1`, which heuristics would mis-tag as
   `apiFamily: "shopper.auth.v1"`; the filter restores `apiFamily: "shopper"`.

The result is always a superset of the request context and never throws.

## Parameters

### params

The series' category, metric id, series id, and request context

#### category

`"ocapi"` \| `"mrt"` \| `"ecdn"` \| `"overall"` \| `"sales"` \| `"third-party"` \| `"scapi"` \| `"scapi-hooks"` \| `"controller"`

#### context

[`MetricsTagContext`](../interfaces/MetricsTagContext.md)

#### metricId

`string`

#### seriesId

`string`

## Returns

[`MetricSeriesTags`](../type-aliases/MetricSeriesTags.md)

The extracted [MetricSeriesTags](../type-aliases/MetricSeriesTags.md)

## Example

```typescript
parseSeriesTags({
  category: 'scapi', metricId: 'cacheHitRate',
  seriesId: 'bdpx.product HIT', context: {tenantId: 'f_ecom_bdpx_prd'},
});
// → { realm: 'bdpx', environment: 'prd', apiFamily: 'product', cacheStatus: 'HIT' }
```
