--- title: "onPageMatched" slug: "onpagematched" updated: 2024-06-13T00:14:55Z published: 2024-06-13T00:14:55Z canonical: "docs.xgen.ai/onpagematched" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.xgen.ai/llms.txt > Use this file to discover all available pages before exploring further. # onPageMatched The `onPageMatched` function will run once all the triggers to the page it is assigned two are `true` and the page has been matched. This can be used to add additional functionality. > This function can be async and will be awaited before the render API is called. #### Syntax ```javascript onPageMatched: () => {} onPageMatched: async () => {} ``` #### Usage `onPageMatched` can be any callback function and can included any code that needs to run once a specific page has been matched. #### Example ```javascript onPageMatched: () => {  trackPdp(...) } ``` In this example, we are using the `onPageMatched` function to fire PDP tracking events.