Creating Page ID naming conventions

To ensure consistent, readable, and maintainable page reporting, you should create a global page naming convention before you start to tag your site.

Digital Analytics uniquely identifies pages within a site based on a 'Page ID' value. This Page ID is passed to Digital Analytics as parameter 1 of the Page View tag and possibly also generated automatically by the Product View tag, depending on your implementation. Activity metrics for pages that share the same Page ID value are reported as the same 'Page Name' in Digital Analytics.

A Page ID can be any alphanumeric string built and passed into parameter 1 of the Page View tag function. To avoid static assignment of a Page ID value for every page in the site, design a page naming convention supporting generation of appropriately unique and descriptive Page ID values based on a set of code rules and available information.

If a Page ID value is not provided with the Page View tag function call, a value is generated by Digital Analytics 'eluminate.js' library code based on the Page URL. Rather than using the entire URL, which might be lengthy and include various situation-specific query string parameter values, the path and filename are sourced from window.location.pathname. For example, the following value is generated if no Page ID parameter value is provided in the Page View tag:

Page URL: http://www.client.com/x/y/z/thepage.html?param=1

Page ID: /x/y/z/thepage.html

This pathname-based naming convention might not work well in all situations. The pathname value typically does not serve as an optimal reporting Page ID for dynamically generated or templated pages. For example, the template "/category.asp" used to display all product category pages results in a single tracked page "/category.asp" in reporting, when in reality the visitor is viewing many different 'pages', such as 'mens shirts', 'womens shoes', etc.

Recommended Page ID Conventions

  • Product View Pages - "Product:<product_name> (<product_id>)"
  • Category Pages - "Category: <category_name>"
  • Successful Search Results Page - "Search Results: Successful page <page_num>"
  • Unsuccessful Search Results Page - "Search Results: Unsuccessful"