EVGItem Class Reference

Inherits fromDeclared in
NSObjectEVGItems.h

Overview 

Abstract base class. An item is something in a site or app that users can view or otherwise engage with. Typical examples are products, articles and blogs. Marketing Cloud Personalization tracks descriptive fields and user activity against items. This activity can be used to build reports and to promote relevant items to users.

All fields are optional unless otherwise stated. Generally, optional fields should only be sent if they are specific to this transaction (e.g. lineItem.item.price) or if they aren’t already being sent along with web activity on the same dataset.

See Also

evgId 

Required. Uniquely identifies an Item. The ID of a category must also identify its parents, separated by pipe | characters. If a category has the ID parent and another category is the child of the first, the child’s ID might be parent|child.

1@property (nonnull, nonatomic, copy) NSString *evgId

name 

Name of a product, category or tag. For an article or blog this is the title.

1@property (nullable, nonatomic, copy) NSString *name

evgDescription 

Overview text about the item.

1@property (nullable, nonatomic, copy) NSString *evgDescription

url 

Link to this item.

1@property (nullable, nonatomic, copy) NSString *url

imageUrl 

Fully-qualified URL for the image representing this item.

1@property (nullable, nonatomic, copy) NSString *imageUrl

published 

If set, this item will be published/available on or after this time. Unpublished items will be excluded from promotion campaigns.

1@property (nullable, nonatomic, strong) NSDate *published

expiration 

If set, this item will be expired/unavailable on or after this time. Expired items will be excluded from promotion campaigns.

1@property (nullable, nonatomic, strong) NSDate *expiration

tags 

Additional descriptive tags about an item such as Brand for products or Author and Keywords for articles.

1@property (nullable, nonatomic, strong) NSArray<EVGTag*> *tags

promotionState 

An optional promotion state that modifies how items will be selected and ordered for promotion. For allowed values and their meanings, see EVGPromotionState .

1@property (nonatomic) EVGPromotionState promotionState

location 

Location related to this item.

1@property (nullable, nonatomic, strong) EVGLocation *location

Availability

1.3.0

rating 

Overall score for the item.

1@property (nullable, nonatomic, strong) NSNumber *rating

Availability

1.3.0

numRatings 

Total number of ratings given to this item, >=0

1@property (nullable, nonatomic, strong) NSNumber *numRatings

Availability

1.3.0

fromJSONDictionary: 

Create an EVGItem subclass of the appropriate type from the provided JSON.

1+ (nullable instancetype)fromJSONDictionary:(nonnull NSDictionary<NSString*,id> *)json

Parameters

ParameterDescription
jsonA type of item in JSON form

Return Value

An EVGItem subclass, or nil if JSON is invalid

fromJSONArray: 

Create an array of EVGItem subclasses from the provided JSON array.

1+ (nullable NSArray<EVGItem*> *)fromJSONArray:(nonnull NSArray<NSDictionary<NSString*,id> *> *)json

Parameters

ParameterDescription
jsonA JSON array of items to convert to an array of EVGItem subclasses

Return Value

An array of EVGItem subclasses, or nil if JSON is invalid