---
schema_version: "1"
id: af51ecc668ae03c05763bcaf52e08adda647c773c3da15e0551c01b2b408abd5
title: QueryParameter()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/sites/mc-ampscript-reference-sites-query-parameter.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-query-parameter.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e8c80f57d5da760fcc69f9206e79bf0418a9cd1c47789bdd0d16415dad2c0f00
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# QueryParameter()

Returns the value of a parameter from a form field or landing page URL parameter. This function can also retrieve parameters from an encrypted query string generated by the [CloudPagesURL()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-cloud-pages-url.md) function.

**note:** This function behaves the same way as the [RequestParameter()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-request-parameter.md) function. We retain both functions in order to preserve backward compatibility.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
QueryParameter(queryParameter)
```

The `QueryParameter()` function has one parameter:

- `queryParameter` (string): Required. The name of the URL query parameter to retrieve the value of.

## Usage

To use this function, pass it the name of the query parameter that contains the value you want to retrieve.

For example, an email can contain a link to a landing page that uses the `CloudPagesURL()` function to include parameters, as in this example.

```html
<a href="%%=CloudPagesURL(314, 'firstName', 'Pooja', 'itemName', 'reticulated widget')=%%">
  Purchase confirmation
</a>
```

You can use this information to personalize the landing page. This example shows how to retrieve the values of the `firstName` and `itemName` parameters and use them in a landing page.

```html
<html>
  <head />
  <body>
    <h1>Thanks for your purchase, %%=ProperCase(QueryParameter("firstName"))=%%!</h1>
    <p>Your %%=QueryParameter("itemName")=%% will ship soon. We know you're going to love it!</p>
  </body>
</html>
```

The rendered HTML contains the content of the specified query parameters.

```html
<html>
  <head />
  <body>
    <h1>Thanks for your purchase, Pooja!</h1>
    <p>Your reticulated widget will ship soon. We know you're going to love it!</p>
  </body>
</html>
```
