Capture Site Structure with Page Types

The setPageType method call sends the page type for a page that a site visitor is on to Monetate. This information also allows you to limit actions to specific page types when you add action conditions to Web experiences.

For example, if you want to display a hero banner only on your site's home page, then you must consider all of the possible URLs:

  • http://example.com
  • http://example.com/
  • https://example.com
  • https://example.com/
  • http://www.example.com
  • http://www.example.com/
  • https://www.example.com
  • https://www.example.com/

By defining a page type, you can reliably target visitors with "pagetype=main" and not need to know every possible URL or write complex regular expressions to define the right URLs. Instead, add an action condition based on the information passed to Monetate from the setPageType API method.

Code ExampleTips
// setPageType Method
window.monetateQ.push([
 "setPageType",
 "idString"
]);
You can pass any string value for page type, but Monetate recommends using a single word with lowercase values because they are easier to remember.
// setPageType Example
window.monetateQ.push([
 "setPageType",
 "main"
]);
Key pages to set page types for include the home page, index page, search page, product detail page, cart page, checkout page, and purchase confirmation page. You can include anything you like. Other page types may include store locator pages, Contact Us pages, and more.