# Using URL parameters

## Tracking and UTM fields

### Macros

You can access UTM values using macros within your templates and form fields.

```markup
<p>${utm_campaign}</p>
```

## Other URL parameters

If a param is not the list of pre-approved parameters above under [Tracking and UTM fields](/themes-and-custom-templates/using-url-parameters.md#tracking-and-utm-fields), then that URL parameter will need to be whitelisted in your project settings.

But once whitelisted, you can use them in your templates

### Macros

You can access these whitelisted URL parameters in your template using macros.

Example: `https://www.example.com/?campaignid=12345`

```markup
<p>${urlparam_campaignid}</p>
```

Would output

```markup
<p>12345</p>
```

## Use in templating

Both UTM (campaign parameters) and the other URL parameters are available within jinja templates in the same place.

Example: `https://www.example.com/?promo=august&utm_campaign=email`

```markup
<p>Promo: {{ request_params.promo }}</p>
<p>Campaign: {{ request_params.utm_campaign }}</p>
```

Would output

```markup
<p>Promo: august</p>
<p>Campaign: email</p>
```

To easily access these values in javascript, you can output request\_params to JSON

```html
<script>
var requestParams = {{ request_params|tojson|safe }};
</script>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devhub.com/themes-and-custom-templates/using-url-parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
