###SetPageType SetPageType API
The setPageType method is used to set a page type that describes the type of page a visitor views on your site. Page types are used to consistently target actions and are a helpful alternative to manual URL targeting.
// setPageType Method
window.monetateQ.push([
"setPageType",
"idString"
]);
// setPageType Example
window.monetateQ.push([
"setPageType",
"main"
]);
###Examples of Page Types
####Useful Methods addCategories
The addCategories method is an array of strings that allows you to add identifiers to a trackData call. These strings have no connection to products or items and they do not necessarily represent groupings of products or services from a catalog; however, this method could be used to indicate that the visitor is currently on a page that is displaying products from a certain category.
// addCategories Method
window.monetateQ.push([
"addCategories",
["string", "string", "string"]
]);
The addProducts method is used to add items a user views on index or search pages. These are generally smaller thumbnail images that lead a user to more detailed information about that product.
// addProducts Method
window.monetateQ.push([
"addProducts",
["pidString",
"pidString",
"pidString"]
]);
An example using addCategories and addProducts in conjunction with setPageType
window.monetateQ = window.monetateQ || [];
window.monetateQ.push(["setPageType", "index"]);
window.monetateQ.push([“addCategories", “shirts"]);
window.monetateQ.push(["addProducts",
["25503585","25795715",
"25591978","25591412",
"25591289","25591923",
"25591189"]]);
window.monetateQ.push(["trackData"]);