Freigeben über


Commerce Foundation ContentSelector

This Commerce Server 2009 commerce entity represents the object of the same name in Commerce Server. You can use it in a model-based query operation to run the Content Selection Framework (CSF) pipeline and retrieve the advertisements that are best suited for the current site context.

Model

This commerce entity can be modified, as required. This model, taken from the out-of-the-box site, is provided as an example.

<CommerceEntity name="ContentSelector">
    <DisplayName value="Content Selector" />
    <Description value="Represents the criteria used to select advertising content from the Commerce Server marketing system."/>
    <Properties>
      <Property name="UserId" dataType="String">
        <DisplayName value="User Id"/>
        <Description value="The id of the user whose information will be provided as contextual data to the content selection framework.  This property is optional."/>
      </Property>
      <Property name="AddressId" dataType="String">
        <DisplayName value="Address Id"/>
        <Description value="The id of the user addres that will provided as contextual data to the content selection framework.  This property is optional."/>
      </Property>
      <Property name="CatalogName" dataType="String">
        <DisplayName value="Catalog Name"/>
        <Description value="The name of the catalog containing a product that will be provided as contextual data to the content selection framework.  This property is optional."/>
      </Property>
      <Property name="ProductId" dataType="String">
        <DisplayName value="Product Id"/>
        <Description value="The id of the product that will provided as contextual data to the content selection framework.  This property is optional."/>
      </Property>
      <Property name="VariantId" dataType="String">
        <DisplayName value="Variant Id"/>
        <Description value="The id of the product variant that will be provided as contextual data to the content selection framework.  This property is optional."/>
      </Property>
      <Property name="PageGroup" dataType="String">
        <DisplayName value="Page Group"/>
        <Description value="The name of the page group for which the advertising content is being selected."/>
        <DefaultValue value="All"/>
      </Property>
      <Property name="Size" dataType="String">
        <DisplayName value="Size"/>
        <Description value="A name representing the size of the content to be selected.  This corresponds to the tag name of a Commerce Server display size.  This property is optional."/>
      </Property>
      <Property name="ContentVariety" dataType="String">
        <DisplayName value="Content Variety"/>
        <Description value="A name representing the variety of content to be selected.  This corresponds to the name of a Commerce Server display template.  This property is optional."/>
      </Property>
      <Property name="ContextNames" dataType="Array">
        <DisplayName value="Context Names"/>
        <Description value="The name of the contexts in which the advertising content should be selected.  This corresponds to the name of one or more Commerce Server content selector.  This property is required."/>
      </Property>
      <Property name="PageHistory" dataType="Array">
        <DisplayName value="Page History"/>
        <Description value="The ids of advertisements that have been selected for the current presentation context.  When returned as part of query, this will contain the ids of all advertisements selected.  This property is optional."/>
      </Property>
      <Property name="CampaignHistory" dataType="Array">
        <DisplayName value="Campaign History"/>
        <Description value="The ids of the advertisements that have been recently viewed by the user for which the advertising content is being selected."/>
      </Property>
    </Properties>
    <Relationships>
      <Relationship name="TargetingContext" type="Relationship" modelName="TargetingContext" isMultipleItems="false">
        <DisplayName value="Targeting Context"/>
        <Description value="Represents extensible targeting information that can be provided to the content selection framework."/>
      </Relationship>
      <Relationship name="Advertisements" type="Relationship" modelName="Advertisement" isMultipleItems="true">
        <DisplayName value="Advertisements"/>
        <Description value="Represents the advertising content that was selected as part of a ContentSelector query."/>
      </Relationship>
    </Relationships>
</CommerceEntity>

Properties

Property

Type

Description

AddressId

String

Specifies the ID of the address profile to provide to the ContentSelector.

CampaignHistory

String[]

A list containing the IDs of Advertisements that the current user has recently viewed. If specified, items not contained in the list will be favored—this is to reduce the number of times that a user will be served the same content item.

When the ContentSelector is returned as part of a query, this contains the updated CampaignHistory for the current user. It is the presentation layer’s responsibility to safely store this information, for example, in a cookie for Web applications or in the user application data directory for WinForms applications.

CatalogName

String

Identifies the catalog that contains the product that is being targeted.

ContentVariety

String

If specified, only content items of the provided variety will be selected. For Commerce Server this is the display template.

ContextNames

String[]

Identifies the Commerce Server configuration that the system will use to perform the content selection. The selection contexts will be queried in the same order in which they are listed. The values in this array must be the names of content selectors configured in the contentSelection element of web.config or ChannelConfiguration.config.

PageGroup

String

Identifies the logical group of pages to target.

PageHistory

String[]

Holds a list of the IDs of the content items that have already been selected for the current page. If specified, the content items in the list will not be selected—this is to make sure that the same content item is not selected multiple times for the same page.

When the system returns the ContentSelector as part of a query, it contains the updated PageHistory for the current page.

ProductId

String

Identifies the product to target.

Size

String

If specified, only selects content items of the provided size. For Commerce Server this is the display size tag name.

UserId

String

Identifies the user that is being targeted.

VariantId

String

Identifies the variant of the product to target.

Relationships

Relationship

Description

Advertisements

Relationship list that contains the advertisements that were selected when the ContentSelector is returned as part of a query.

TargetingContext

Relationship that contains additional targeting information to provide to the ContentSelector. To provide this information to the content selection framework, the TargetingContext object must be provided in the search model when executing a query operation.

Supported Operations

The Content Selector commerce entity supports the following operations:

Commerce Foundation ContentSelector CommerceQuery

Commerce Foundation ContentSelectorCollection CommerceQuery

See Also

Other Resources

Developing with the Commerce Foundation Marketing System

Commerce Foundation ContentSelectorCollection

Commerce Foundation ContentSelector CommerceQuery

Commerce Foundation ContentSelectorCollection CommerceQuery