Share via


Working With the Discount Ad Web Part

The Discount Ad Web Part displays advertisements and discounts that are relative to both the current shoppers and their current site context. The Discount Ad Web Part records click events on the served advertisements to monitor the progress of paid advertisements, as well as provide metrics on program success.

Web Part

The main functions of the Discount Ad Web Part are:

  • Serves the advertisements or discounts most relative to the current shoppers and their current site context

  • Records click events on the advertisements and discounts

  • Can serves advertisements and discounts specific to a channel

  • Allows the display size of the advertisement to be configured

  • Serves advertisements based on the shopper history of viewed advertisements

  • Serves an image or HTML code of all supported Commerce Server 2009 campaigns (advertisement and discount) display types for an advertisement or discount

The advertisement targeting is based on the following aspects:

  • Current shopper’s identity

  • Current products viewed

  • Current Page Group being viewed (defined in the Marketing Manager)

  • Desired displayable content size

  • An advertisements historical information

  • Current channel

To record a click event on an advertisement, the Discount Ad Web Part provides the following information:

  • Advertisement ID (or any other unique entity of interest)

  • Page Group on which event is observed

  • Event name

  • Name of the Commerce Server 2009 cache that contains the advertisement

  • Name of the Commerce Server 2009 pipeline that used to record the event

The Discount Ad Web Part uses .NET Framework controls to format its output.

Property Sheet

The Discount Ad Web Part property sheet lets site designers control how advertisements and discounts are displayed on a page. The following figure shows the Discount Ad Web Part property sheet. The property sheet is displayed by selecting the edit option on the Web Page (in Edit Page mode) and then selecting Modify Shared Web Part. This displays the property sheet. Expand the sections to see the relevant properties. The property sheet has several settings in the Commerce Settings section that dictate what is served to the shopper, and how it is laid out.

Dd328185.vugadlistpropertysheet(en-US,CS.90).gif

Properties

The following table lists and describes the properties on the Discount Ad Web Part.

Property

Type

Description

Default

Content selection: Type

Enum

Sets the content type criterion which affects the selection of content that can appear on this Web Part.

Advertising

Content selection: Display size

String

Sets the display size criterion which affects the selection of content that can appear on this Web Part. The size name used must match one that has been set up in the Commerce Server Core Marketing System.

Blank

Content selection : Page group

String

Sets the page group of criteria that affects the selection of content that can appear on this Web Part. The value must be one of the page groups set up in the Commerce Server Core Marketing System.

All

Content selection : Product id

String

Sets the product id criterion which affects the selection of content that can appear on this Web Part. Lets you specify a product ID for targeting advertisements; retrieves only those advertisements with this particular product ID associated with it in Marketing Manager.

Blank

Content selection : Desired # of ads

Int

Specifies the number of items to retrieve from Commerce Server 2009. If dealing with advertisements or discounts only, the number represents the number of items to retrieve (so entering 5 will try to retrieve 5 content items; if there are less available, only the available content is returned). If dealing with a combination of advertisements and discounts, in either order, a comma-separated list specifies the number of items to retrieve of each (so entering 3,2 when Advertisements and Discounts is selected will retrieve up to 3 ads and up to 2 discounts, depending on the amount of content available).

Blank

Layout : Mode

Enum

Sets the mode to use when laying out the collection of ads.

Specifies whether to use a table layout (the default and most common setting) or to inherit flow from the previous Web Part layout (see "Managing layout" below),

Table

Layout : # of columns

Int

Sets the number of columns to use when laying out the collection of ads. Content expands across the number of columns regardless of the Layout : orientation property (see "Managing layout" below).

1

Layout : Orientation

Enum

Sets the orientation of the "columns" when laying out the collection of ads.

Vertical

CSS class

NA

Sets the style sheet "class" name used when outputting the HTML markup of this Web Part.

Blank

Managing Layout

The layout of advertisements and discounts in the Discount Ad Web Part depends on a number of settings. If displaying a single ad or discount, most of the Web Part property settings are not applicable

When displaying two ads, if you want them to appear next to each other, use the following settings:

Property

Setting

Layout : Mode

Table

Layout : Orientation

Horizontal

Layout : # of columns

2

To have the two ads appear stacked vertically, the Layout: # of columns needs to be set to 1. The Layout : Orientation does not affect this case, as the one column total forces ads to be vertically stacked.

As the number of ads displayed increases, the Discount Ad Web Part properties have an effect on the order and layout of the advertisements.

For example, if you want to serve five ads in two columns, in a horizontal order, use the following settings:

Property

Setting

Layout : Mode

Horizontal

Layout : Orientation

Table

Layout : # of columns

2

The effect of the change from horizontal to vertical is most easily shown with a simple diagram. To display 5 ads in 2 columns, with Layout : Orientation set to Horizontal, the ads will be displayed in the table in this order:

1

2

3

4

5

Changing the Layout : Orientation to Vertical will alter the order in which the ads are laid out to this:

1

4

2

5

3

Setting Layout: # of columns to 3, serving 5 ads, with Layout : Orientation set to Horizontal, the ads would be laid out like this:

1

2

3

4

5

Changing Layout : Orientation set to Vertical lays out ads in this manner:

1

3

5

2

4

It is important to note that a Layout : Orientation set to Vertical does not mean ads will be laid out on top of each other only; the Layout : # of columns number must be satisfied first for the vertical orientation to be realized. To stack 5 ads on top of each other, with no ads side by side, set the Layout : # of columns to 1.

The Layout : Mode property has two options: Table and Flow. With Table layout, the Discount Ad Web Part is treated like a set of rows and columns and advertisements are laid out in that table's cells, one by one. With Table layout, the Web Part will automatically resize as needed to fit the advertisement sizes unless the Web Part is constrained in size by setting the Width and Height properties for the Web Part itself.

The Flow layout is different than Table layout in two aspects: it will not resize Web Part sizes to fit advertisements automatically. Also, the Flow layout takes the same general direction of advertisement layout as the Web Part possessed previously (if there was a previous layout). For example, if the previous setting was Horizontal and Table, the Flow will remain horizontal if possible, but without any Web Part resizing. If the advertisements cannot fit horizontally, they will be stacked vertically as space allows. If the previous setting was VerticalTable, the vertical orientation is preserved. (It is convenient to think of the Flow layout as being dictated by a style sheet, which can be applied to the advertisement layout; the previous Web Part layout defines the style sheet, but the style sheet may be changed if the Web Part cannot contain the advertisements correctly due to size issues.)

See Also

Other Resources

Working With the Web Parts

Discount Ad Web Part