# 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
}
```
