---
schema_version: "1"
id: 302f8bf8f6a3117a52203bbdc233c57fd5457c63a1623155f1cc20f6c0683d75
title: GetQueryStringParameter
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_utilitiesGetQueryStringParameters.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_utilitiesGetQueryStringParameters.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a55bb5814a39d14be09af1a25a78ff3a90f28d07a49bbb9d06d87bef7c3a116d
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# GetQueryStringParameter

Retrieves the value of a query string parameter from the URL of a landing page or CloudPages page.

## Syntax

`GetQueryStringParameter(1)`

## Function Properties

| Ordinal | Type   | Description                                                                                         |
| ------- | ------ | --------------------------------------------------------------------------------------------------- |
| `1`     | String | Required. The key name of a query string parameter in the URL of a landing page or CloudPages page. |

## Example

This code example retrieves the value of the `firstName` query string parameter in the URL.

```js
<script runat="server">
  Platform.Load("Core", "1");

  var custName = Request.GetQueryStringParameter("firstName");

  # Assign a fallback value if the firstName query parameter is not defined or
  # is an empty string.
  if (!result) {
    custName = "friend";
  }
</script>

<p>Hello <ctrl:var name="custName" />!</p>
```

For example, assume that a user visits a page with this URL:

```
https://www.example.com/welcome.htm?firstName=Martina
```

In this case, because the `firstName` query parameter has a value, the user sees a message that includes their name.

```
Hello Martina!
```

However, if the `firstName` query parameter wasn’t present in the URL, or if the key was specified without a value, the user sees a generic message that contains a fallback value for the `custName` variable.

```
Hello friend!
```
