You can enable it via attributes like [AiMetaTitleGenerator] and [AiMetaDescriptionGenerator], or through configuration when attributes are not applicable.
Attribute-based configuration
For regular CMS content types, metadata generation is enabled via attributes.
Example
[AiMetaTitleGenerator]
public virtual string Title { get; set; }
[AiMetaDescriptionGenerator]
public virtual string MetaDescription { get; set; }
These attributes define:
- Target Property: The property where AI output is written (Title, MetaDescription)
- Input Context: Source content used for generation (default: entire page content)
- Generation Strategy: Predefined prompt/logic for SEO-friendly output
Optimizely Commerce SeoInformation
SeoInformation is a built-in block in Optimizely Commerce that includes Title and Description properties, representing SEO metadata for catalog entries and nodes.
Built-in SeoInformation
public class SeoInformation : BlockData
{
public virtual string Title { get; set; }
public virtual string Description { get; set; }
public virtual string Keywords { get; set; }
}
Since these properties cannot be decorated with custom attributes directly, an alternative approach is used to attach MetaTitleGenerator and MetaDescriptionGenerator logic via an initialization module.
Example: Configure metadata generation for all commerce entries
[InitializableModule]
public class AiAssistantInitialization : IInitializableModule
{
public void Initialize(InitializationEngine context)
{
var entryContentBaseBuilder = AiBuilder.ForContentType<EntryContentBase>();
entryContentBaseBuilder
.With(x => x.SeoInformation.Title)
.Use<AiMetaTitleGeneratorAttribute>();
entryContentBaseBuilder
.With(x => x.SeoInformation.Description)
.Use<AiMetaDescriptionGeneratorAttribute>();
}
public void Uninitialize(InitializationEngine context)
{
}
}
This initialization module configures AI metadata generation for all Commerce entry content by registering generators at application startup.
- Scope: By registering at EntryContentBase, the metadata generators automatically apply to all derived content types without requiring individual configuration. You can also target specific content types, such as products or variants,
- Property Mapping: Each With(...) call specifies a target property within SeoInformation:
-
- SeoInformation.Title: SEO title
- SeoInformation.Description: meta description
- Generator assignment: The method Use<...>() attaches the corresponding AI generation logic to the target properties. It reuses the same behavior as attribute-based configuration, but applies it programmatically.