EVGItem Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | EVGItems.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. Evergage 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 EVGCategory, EVGTag, EVGProduct, EVGArticle, and EVGBlog.
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".
@property (nonnull, nonatomic, copy) NSString *evgIdDeclared In
EVGItems.h
name
Name of a product, category or tag. For an article or blog this is the title.
@property (nullable, nonatomic, copy) NSString *nameDeclared In
EVGItems.h
evgDescription
Overview text about the item.
@property (nullable, nonatomic, copy) NSString *evgDescriptionDeclared In
EVGItems.h
imageUrl
Fully-qualified URL for the image representing this item.
@property (nullable, nonatomic, copy) NSString *imageUrlDeclared In
EVGItems.h
published
If set, this item will be published/available on or after this time. Unpublished items will be excluded from promotion campaigns.
@property (nullable, nonatomic, strong) NSDate *publishedDeclared In
EVGItems.h
expiration
If set, this item will be expired/unavailable on or after this time. Expired items will be excluded from promotion campaigns.
@property (nullable, nonatomic, strong) NSDate *expirationDeclared In
EVGItems.h
tags
Additional descriptive tags about an item such as Brand for products or Author and Keywords for articles.
@property (nullable, nonatomic, strong) NSArray<EVGTag*> *tagsDeclared In
EVGItems.h
promotionState
An optional promotion state that modifies how items will be selected and ordered for promotion. See
EVGPromotionState for allowed values and their meanings.
@property (nonatomic) EVGPromotionState promotionStateDeclared In
EVGItems.h
location
Location related to this item.
@property (nullable, nonatomic, strong) EVGLocation *locationAvailability
1.3.0
Declared In
EVGItems.h
rating
Overall score for the item.
@property (nullable, nonatomic, strong) NSNumber *ratingAvailability
1.3.0
Declared In
EVGItems.h
numRatings
Total number of ratings given to this item, >=0
@property (nullable, nonatomic, strong) NSNumber *numRatingsAvailability
1.3.0
Declared In
EVGItems.h
+ fromJSONDictionary:
Create an EVGItem subclass of the appropriate type from the provided JSON.
+ (nullable instancetype)fromJSONDictionary:(nonnull NSDictionary<NSString*,id> *)jsonParameters
json |
A type of item in JSON form |
|---|
Return Value
An EVGItem subclass, or nil if JSON is invalid
Declared In
EVGItems.h
+ fromJSONArray:
Create an array of EVGItem subclasses from the provided JSON array.
+ (nullable NSArray<EVGItem*> *)fromJSONArray:(nonnull NSArray<NSDictionary<NSString*,id> *> *)jsonParameters
json |
A 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
Declared In
EVGItems.h