Skip to main content

Definition aliases


A definition's alias is the culture-independent name of a definition.

A definition’s alias is represented by the definition’s item name in Sitecore and is the culture-independent name of a definition. In the following example, the goal’s alias is My goal name and its English name is English goal name. Culture-specific names are represented by the Name field on the item as shown:

Example definition alias and a culture-specific name

You must specify an alias and a culture-specific name each time you create a definition.

Guid goalId = Guid.NewGuid(); // Goal ID
CultureInfo goalCulture = new CultureInfo("es"); // Goal culture
string goalName = "Newly created goal"; // Goal name
DateTime creationDate = DateTime.UtcNow; // Goal creation date
string createdBy = "sitecore\admin"; // Goal creator
var goalAlias = "Newly created item name/alias"

Sitecore.Marketing.Definitions.Goals.GoalDefinition goal = new Sitecore.Marketing.Definitions.Goals.GoalDefinition(goalId, goalAlias, goalCulture, goalName, creationDate, createdBy);

Alias uniqueness and validation

Aliases must be unique within definition types. For example, you can have a goal named Hello World and a campaign named Hello World, but you cannot have two campaigns named Hello. This is true even if the campaigns are created in different parts of the content tree.

By default, aliases are validated against the following regular expression: ^[a-zA-Z0-9_\-\x20]*$

You can customize alias validation by changing the regular expression in the MarketingDefinitionAliasValidationRegex application setting for all instances of the roles that marketing operations are included in: Content Delivery, Content Management, and xDB Processing. You must use the same expression in all instances of the setting. Replace the following default expression:

  <add key="MarketingDefinitionAliasValidationRegex" value="^[a-zA-Z0-9_\-\x20]*$" />