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 *evgId
Declared 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 *name
Declared In
EVGItems.h
evgDescription
Overview text about the item.
@property (nullable, nonatomic, copy) NSString *evgDescription
Declared In
EVGItems.h
imageUrl
Fully-qualified URL for the image representing this item.
@property (nullable, nonatomic, copy) NSString *imageUrl
Declared 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 *published
Declared 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 *expiration
Declared 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*> *tags
Declared 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 promotionState
Declared In
EVGItems.h
location
Location related to this item.
@property (nullable, nonatomic, strong) EVGLocation *location
Availability
1.3.0
Declared In
EVGItems.h
rating
Overall score for the item.
@property (nullable, nonatomic, strong) NSNumber *rating
Availability
1.3.0
Declared In
EVGItems.h
numRatings
Total number of ratings given to this item, >=0
@property (nullable, nonatomic, strong) NSNumber *numRatings
Availability
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> *)json
Parameters
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> *> *)json
Parameters
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