- pagePlugin
Plugin that adds general page-related methods to ddl-tools.
- PlainPageCategory
Page categorization data.
- PlainPageInfo
Standard page information.
- PlainPage
Metadata describing a web page.
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
- .mergePage(page) ⇒
object
- .setPageInfo(pageInfo) ⇒
object
- .mergePageInfo(pageInfo) ⇒
object
- .setPageCategory(category) ⇒
object
- .mergePageCategory(category) ⇒
object
- .setPageAttributes(attributes) ⇒
object
- .mergePageAttributes(attributes) ⇒
object
- .addPageAttribute(name, value) ⇒
object
- .setPage(page) ⇒
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |