Skip to content

Latest commit

 

History

History
233 lines (176 loc) · 8.91 KB

ddl-tools-plugin-page.md

File metadata and controls

233 lines (176 loc) · 8.91 KB

Constants

pagePlugin

Plugin that adds general page-related methods to ddl-tools.

Typedefs

PlainPageCategory

Page categorization data.

PlainPageInfo

Standard page information.

PlainPage

Metadata describing a web page.

pagePlugin

Plugin that adds general page-related methods to ddl-tools.

Kind: global constant
Example

import DDLTools from 'ddl-tools';
import DDLValidator from 'ddl-validator';
import pagePlugin from 'ddl-tools-plugin-page';
import schema from './path/to/mySchema';

const ddlValidator = new DDLValidator(schema);
const ddlTools = new DDLTools(window.digitalData, ddlValidator);
ddlTools.use(pagePlugin);

pagePlugin.setPage(page) ⇒ object

Records page metadata by replacing page with the page argument, destroying any existing page metadata.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
page PlainPage Web page metadata

pagePlugin.mergePage(page) ⇒ object

Updates page metadata by deeply merging the key/value pairs from the page argument into the page object, creating a new page object if one did not already exist.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
page PlainPage Web page metadata

pagePlugin.setPageInfo(pageInfo) ⇒ object

Records detailed page information by replacing page.pageInfo with the pageInfo argument, destroying any existing detailed page information.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
pageInfo PlainPageInfo Detailed page information

pagePlugin.mergePageInfo(pageInfo) ⇒ object

Updates detailed page information by deeply merging the key/value pairs from the pageInfo argument into the page.pageInfo object, creating a new page.pageInfo object if one did not already exist.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
pageInfo PlainPageInfo Detailed page information

pagePlugin.setPageCategory(category) ⇒ object

Records page categorization data by replacing page.category with the category argument, destroying any existing page categorization data.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
category PlainPageCategory Page categorization data

pagePlugin.mergePageCategory(category) ⇒ object

Updates page categorization data by deeply merging the key/value pairs from the category argument into the page.category object, creating a new page.category object if one did not already exist.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining
See: https://www.w3.org/2013/12/ceddl-201312.pdf

Param Type Description
category PlainPageCategory Page categorization data

pagePlugin.setPageAttributes(attributes) ⇒ object

Records additional facts about the page by replacing page.attributes with the attributes argument, destroying any existing attributes.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining

Param Type Description
attributes object Additional facts about the page

pagePlugin.mergePageAttributes(attributes) ⇒ object

Updates additional facts about the page by deeply merging the key/value pairs from the attributes argument into the page.attributes object, creating a new page.attributes object if one did not already exist.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining

Param Type Description
attributes object Additional facts about the page

pagePlugin.addPageAttribute(name, value) ⇒ object

Records an additional fact about the page.

Kind: static method of pagePlugin
Returns: object - - Self reference for chaining

Param Type Description
name string Attribute name
value mixed Attribute value

PlainPageCategory

Page categorization data.

Kind: global typedef
Properties

Name Type Description
primaryCategory string Top-level category of the page
subCategory string Sub-level category of the page
productType string Type of product in the page

PlainPageInfo

Standard page information.

Kind: global typedef
Properties

Name Type Description
pageID string Page's identifier
pageName string Page's name
destinationURL string Page's URL (ie. document.location)
referringURL string URL that referred user to the page (ie. document.referrer)
sysEnv string Page's system environment
variant string Page variant (ie. A/B testing bucket)
version string Page's version number
breadCrumbs Array.<string> Page's bread crumbs (semantic path)
author string Name of the page's author
issueDate string | Date Date page was issued on (JS Date or ISO 8601)
effectiveDate string | Date Page's effective date (JS Date or ISO 8601)
expiryDate string | Date Page's expiry date (JS Date or ISO 8601)
language string Human language the page is written in (ISO 639)
geoRegion string Geographic region (ie. country) (ISO 3166)
industryCodes string Industry codes page applies to (Standard Industrial Classification [SIC] code)
publisher string Page's publisher name

PlainPage

Metadata describing a web page.

Kind: global typedef
Properties

Name Type Description
pageInfo PlainPageInfo Standard page information
category PlainPageCategory Page categorization data
attributes object Extensible key-value pairs describing additional facts about the page