Jaa


CSFRecordEvent

Use the CSFRecordEvent pipeline component to record event delta counts for the selected content items (the winners) in the Performance dictionary.

Intended use: Content Selection pipeline, Record stage; Order Processing pipeline, Accept stage.

Values Read

The CSFRecordEvent pipeline component reads the following values from the indicated dictionaries.

Key

Dictionary

Description

_event

Order

A string that contains the name of the event to record.

_performance

Order

Specifically, the previous event delta count for the various content items.

_winners

Order

A SimpleList Object that contains values from the item_id keys of the selected (winning) content items.

If this key is present, the _winnerindexes key should not be present. If both are present, only the_winnerindexeskey is used.

_eventcount

Order

Optional. A SimpleList object that contains the number of events to record for each winning content item. It must contain the same number of elements as the _winners list.

One event is recorded for each winning item if this key is not present.

_winnerindexes

Order

Optional. A SimpleList object that contains the ContentList Object indexes of the winning content items.

If this key is present, the _winners key should not be present. If both are present, only this key is used.

_content.item_id

Order

Optional. The item_id key for the various content items that are contained in the ContentList referenced by _content.

If the _content key is present, the referenced ContentList object must have a column nameditem_id.

cachename

Context

A string that is the name of the current content cache.

_cache

Context

Optional. The dictionary that contains the items that were retrieved from this cache.

Values Written

The CSFRecordEvent pipeline component writes the following values to the Order dictionary.

Key

Description

_performance

The Performance dictionary. This key will contain the new event delta counts for the various content items.

_content.invalid_nod

Optional. A Boolean flag for each item in the ContentList object. Set this key to True if the item must have the Need of Delivery (NOD) recalculated.

Remarks

The following are the names of the predefined events for campaigns:

  • REQUEST. A content request event.

  • CLICK. A click event for an ad or a promotion.

  • DOWNLOAD. A download of a GIF image or other advertising asset from the Web server.

  • SOLD. An item sold event, such as for a promotion or bounty ad.

You can record custom events by creating new CampaignEventType objects by using the NewCampaignEventType method. The following code demonstrates how you can do this:

MarketingContext ctxt = MarketingContext.Create(@"https://localhost/MarketingWebService/MarketingWebService.asmx");
CampaignEventType et = ctxt.Campaigns.NewCampaignEventType();
et.Name = "MyEvent";
et.Description = "My Custom Event";
et.IsSchedulable = true;
et.Save();

This component flags whether the NOD values of the winning content items must be re-calculated. The flag is set to True if the Item dictionary has a NOD key and if the event name matches the type of event the item is scheduled by.

The NOD values can be recomputed if there is no ContentList object (when the _Contentkey is not present) if the _winners key is passed instead of the _winnerindexes key.

The Performance dictionary contains a sub-dictionary for each content item for which an event has occurred, keyed by the item_id key. Each sub-dictionary maps event names to a count of the number of new occurrences of that event. Periodically, the total in the database for each event for each content item will be incremented by this amount. The CSFRecordEvent pipeline component is responsible for creating keys in these dictionaries as needed and incrementing the corresponding values. The WriteEvents cache component is responsible for recording the increments in the running totals in the database.

See Also

Reference

CampaignEventType

CampaignManager

Other Resources

Pipeline Component Reference