---
schema_version: "1"
id: 0e5cc7df5d5b20c4cd179f69ccbf2dc95dcd2cff8c9dd9e63daa6fcf15ebe88b
title: MicrositeURL()
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-microsite-url.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-microsite-url.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: baf609ced7386dfab13c800628c92a3ee9bf65a8ed99d77e288c6c676beaa3d3
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# MicrositeURL()

Returns a microsite URL with an encrypted query string. Use this function to link to microsites created in Classic Content from emails. Because this function encrypts your query parameters, you can use it to avoid submitting customer data as plain text.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>❌ No</td>
  </tr>
</table>

## Syntax

```
MicrositeURL(pageId,
             parameterName1, parameterValue1,
             [parameterName2, parameterValue2] ... )
```

The `MicrositeURL()` function has three parameters:

- `pageId` (number): Required. The page identifier of a CloudPages landing page.
- `parameterName1` (string): The name of the item that you want to include as an encrypted query parameter.
- `parameterValue1` (string): The value of the item that you want to include as an encrypted query parameter.

You can pass multiple query string parameters by appending their names and values to the end of the function. You can include as many query string parameters as necessary.

These names are reserved and can’t be used as query parameter names:

- `PAGEID`
- `MID`
- `JID`
- `LID`
- `SID`
- `JSB`
- `URLID`

## Usage

To use this function, pass it the ID of a microsite created in Classic Content.

```html
<p>
  <a title="MyPage" href="%%=MicrositeURL(77777)=%%" alias="ThisAlias" conversion="false"
    >Click to unsubscribe</a
  >
</p>
```

This example uses additional parameters:

```html
<p><a title="MyPage" href="%%=MicrositeURL(77777, "Extra1", "ABC", "Extra2", "123")=%%" alias="ThisAlias" conversion="false">Click to unsubscribe</a></p>
```

To add query strings to the URL, use [Concat()](https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/string/mc-ampscript-reference-string-concat.md) to place an ampersand after the URL.

```html
<p>
  <a
    title="MyPage"
    href="%%=Concat(MicrositeURL(77777),'&')=%%"
    alias="ThisAlias"
    conversion="false"
    >Click to unsubscribe</a
  >
</p>
```

If you have a non-Enterprise 2.0 account, use `microsite_base_url` instead:

```
<a href="%%microsite_base_url[default]151515151[/default]%%">Click to unsubscribe</a>
```
