Home > widget-integration > FilterService > saveCollectionInfo

FilterService.saveCollectionInfo() method

Saves collection information during initialization.

Stores the mapping between collection handle and collection ID in localStorage. This enables retrieving collection ID from handle when parsing URLs or processing collection filters.

Signature:

saveCollectionInfo(): void;

Returns:

void

Remarks

Only saves on collection pages (page === 'collection') and when collection_handle is present. The mapping persists across sessions for fast collection ID lookup.

Example

Override to add custom collection tracking:

saveCollectionInfo() {
  super.saveCollectionInfo();
  const { collection_id, collection_handle } = this.appService.TAEAppConfig.generalSettings;
  if (collection_handle) {
    // Track collection view for recommendations
    this.trackCollectionView(collection_id, collection_handle);
  }
}