--- title: "pageViewMetricsHandler()" slug: "pageviewmetricshandler" updated: 2024-07-17T19:08:52Z published: 2024-07-17T19:08:52Z canonical: "docs.developer.comcast.com/pageviewmetricshandler" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.developer.comcast.com/llms.txt > Use this file to discover all available pages before exploring further. # pageViewMetricsHandler() ## pageViewMetricsHandler() Logs a metric when a user has viewed a specific page in the X1 Application. This can be used to obtain product metrics. #### Signature: `$badger.pageViewMetricsHandler(page, args)` #### Parameters: | parameter | description | data type | required? | | --- | --- | --- | --- | | page | Name of the page that was viewed. This can be any value which is meaningful to your X1 App | String | Yes | | args | Optional arguments to include.The individual properties in args must be primitives (`string`, `numeric` or `boolean`). Nesting of properties is not supported. | Object | No | #### Return Values: None. #### Usage Example: ``` $badger.pageViewMetricsHandler("searchResults", { prevPage: "login", pageLoadTimeMs: 735 }); ```