Home > widget-integration > RecommendationModule > parseWidgetId

RecommendationModule.parseWidgetId() method

Parses the widget ID from the block ID. Override this method to customize widget ID extraction logic for different shops or naming conventions.

Signature:

protected parseWidgetId(blockId: string): string;

Parameters

Parameter

Type

Description

blockId

string

The raw block ID from TAE

Returns:

string

The parsed widget ID

Example

// Custom widget ID parsing for shop with different prefix protected parseWidgetId(blockId: string): string { return blockId.replace('custom-widget-prefix-', ''); }