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() function.

This function behaves the same way as the RequestParameter() function. We retain both functions in order to preserve backward compatibility.

Note

Availability 

Marketing Cloud Engagement ✅ Yes
Marketing Cloud Next ❌ No

Syntax 

1QueryParameter(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.

1<a href="%%=CloudPagesURL(314, 'firstName', 'Pooja', 'itemName', 'reticulated widget')=%%">
2  Purchase confirmation
3</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.

1<html>
2  <head />
3  <body>
4    <h1>Thanks for your purchase, %%=ProperCase(QueryParameter("firstName"))=%%!</h1>
5    <p>Your %%=QueryParameter("itemName")=%% will ship soon. We know you're going to love it!</p>
6  </body>
7</html>

The rendered HTML contains the content of the specified query parameters.

1<html>
2  <head />
3  <body>
4    <h1>Thanks for your purchase, Pooja!</h1>
5    <p>Your reticulated widget will ship soon. We know you're going to love it!</p>
6  </body>
7</html>