> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.unicornplatform.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Show the URL parameter in a title

This guide will show you how to capture the URL parameter and insert it into the H1 title of the page.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/screenshot-2023-03-27-at-13294_fs2mv2.png)

# Step 1

Copy this code:

```javascript
<script>
const insertParam = () => {
    const paramName = "NAME";
    const defaultTitle = "Default text";
    const searchParams = new URLSearchParams(window.location.search);
    const param = searchParams.get(paramName);
    const title = document.querySelector('h1');
    const dynamicText = document.querySelector('.dynamic-text');
    if (!title || !dynamicText) return;
    if (!param) {
        title.textContent = defaultTitle;
        return;
    }
    dynamicText.textContent = param;
}
insertParam();
</script>
```

# Step 2

Insert the Custom HTML component at the bottom of the page.

![](https://storage.crisp.chat/users/helpdesk/website/7e782a40c0560c00/screenshot-2023-03-27-at-12133_1upy2di.png)

# Step 3

Paste the code in the editor of this component.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/image_17xd2f9.png =550x600)


Within the code, you can modify the text that will be displayed in the title if there is no parameter in the URL.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/image_1dn3pmb.png =500x500)

# Step 4

Copy this piece of code and paste it in the title, wherever you want the URL parameter to be displayed.

`<span class="dynamic-text"></span>`

![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/image_mgw2mv.png =550x550)

### Done!

The URL parameter will be captured and inserted to the H1 title on your page

### Additional adjustments

To capture a different URL parameter instead of NAME, simply modify the code by replacing NAME with the desired parameter name.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/image_11d7kg7.png =550x600)