> For the complete documentation index, see [llms.txt](https://docs.firework.com/firework-for-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.firework.com/firework-for-developers/web/integration-guide/shopping-integration-v2/tracking/page-viewed.md).

# Page viewed

<pre class="language-javascript"><code class="lang-javascript"><strong>&#x3C;script>
</strong>    function onPageViewed() {
        window._fwn.analytics.pageViewed({
            ext_customer_identifier: '123'
        });
    }
    
    //Call the function when the user first lands on the page
    document.addEventListener('DOMContentLoaded', function() {
        onPageViewed();
    });
&#x3C;/script>
</code></pre>

Note: The page viewed function expects the following input shape:

```typescript
export interface PageViewedData {
  ext_customer_identifier?: string
}
```
