MPSPageParameters

public class MPSPageParameters: NSObject, NSCopying, NSCoding

Facilitates the population of MPS page request parameters. For more info about the MPS page request parameters, please visit: http://mps.click/mps-request-params

  • Initialize the MPSPageParameters.

    Declaration

    Swift

    public init(path: String)

    Parameters

    path

    String - This is the unique identifier for this page/screen/content item. For websites, this is typically the uri path, however for devices driven by services data, this can be constructed - as long as it’s logical and unique per page or content item. Do not include query string parameters in the path (eg: ?slide=1).

  • Path is the unique identifier for this page/screen/content item. For websites, this is typically the uri path, however for devices driven by services data, this can be constructed - as long as it’s logical and unique per page or content item. Do not include query string parameters in the path (eg: ?slide=1).

    Declaration

    Swift

    public var path: String!
  • Type is used to classify content into major display types (e.g. landing, listing, article, video, ecommerce, trailers, theater detail, blog post). This either comes directly from the cms or backend data object or usually corresponds to display templates or views. Content types often contain variations between ad placements on the page.

    Declaration

    Swift

    public var type: String?
  • cat

    Pipe separated list of the category/site/app hierarchy for the current page/screen. This should come directly from the content if available, otherwise use the site map or navigational structure to construct this. This is the most important mps parameter as this is the primary data used to target ads and track metrics. You can pass in up to 5 levels, with the parent (most general) for example, cat=ios|movies|coming_soon (Movies App), (News App) politics|elections|videos, (Cloud storage app) account|files|preview|photo section first, going in order.

    Declaration

    Swift

    public var cat: String?
  • cag

    Content Affinity Groups (CAGs) are used to pass in tag or keyword values to MPS, grouped by sets of terms. It is recommended to pass to all available keyword/tag sets into MPS programatically for each page based on content. For example, genre=Romance|Comedy, rating=PG-13

    Declaration

    Swift

    public var cag: [String: String]?
  • Fields are used to define user session/instance specific terms to MPS. It follows the logic as CAGs (above). Things like login status, zip code, credit card type used are examples of this. For example, field[car]=audi, field[purchase_method]=credit card|visa. The ‘device’, ‘platform’ and ‘sdkVersion’ fields are reserved for internal use.

    Declaration

    Swift

    public var field: [String: String]?
  • This should be the content or page identifier which is usually the CMS or database id. If you do not have a Identifier, pass in nothing and MPS will generate one (based on hash of site+path). If you have multiple systems driving (like a video cms and a blog) the site that use the same id values, prefix the id with a letter for each source (like v123 and b123) for example, content_id=675309

    Declaration

    Swift

    public var contentID: String?
  • Use NSNumber(value: true) for content level views (eg: Article, Slideshow, Video) NSNumber(value: false) for everything else (eg: Homepage, Landing, Content List, Account) for example, is_content=1

    Declaration

    Swift

    public var isContent: NSNumber?
  • Human readable Content, view or page title (e.g. node title). This should come from the cms or backend data object if possible, for example, title=Anchorman 2 Movie Guide

    Declaration

    Swift

    public var title: String?
  • Date of when the content or page was published.

    Declaration

    Swift

    public var pubdate: Date?
  • Further break down more generic content types. For example, if the content type is movie, you could have reviews within it. for e.g.: subtype=Reviews

    Declaration

    Swift

    public var subtype: String?
  • Envelope is used in the cases where an individual page/view belongs to a parent set (or folder) – like if you’re viewing a page with a photo that actually belongs to a parent slideshow. In these cases, the parent content id (recommended) or the name of that parent/folder should be passed as the envelope.

    Declaration

    Swift

    public var envelope: String?
  • This is used for a data source to group of set of pages together into a single package. This can be alphanumeric characters only.

    Declaration

    Swift

    public var pkgid: String?
  • Setting this parameter to NSNumber(value: true) will cause the request to go into “read-only” mode which means that it will attempt to find the existing record using the site/path and read the existing data for the last full request made. It will ignore all existing parameters sent over. If there is no existing record for the site/path combination, then it will serve a fallback (default) response configured for the site.

    Declaration

    Swift

    public var readonly: NSNumber?
  • Skip the MPS server cache.

    Declaration

    Swift

    public var cacheSkip: NSNumber?
  • Additional parameters for the request.

    Declaration

    Swift

    public var additionalParams: [String: String]?