A case for the MicrositeURL() function

Do you know about the MicrositeURL() AMPScript function? It’s relatively new. It sure is handy if you’re building custom preference centers in Enterprise 2.0 business units.

The idea is that you can encrypt custom parameters in your email links to Microsite pages and then retrieve the unencrypted values with an AMPScript function. Once you have the business unit MID in the microsite page, you can use it to ensure your API calls are for the correct business unit.

In your email you would have this code:

In the case where the the subscriberMID is not set, default to the parent business unit’s MID, which is accessible from the memberid personalization string.

One gotcha: If you build your custom preference centers with Server-Side JavaScript, there’s no SSJS function to retrieve the additional MicrositeURL parameters — you to use AMPScript. Your code may end up looking something like this:

For further reading:
Personalization Strings
Server-Side JavaScript

2 Comment threads
1 Thread replies
Most reacted comment
Hottest comment thread
3 Comment authors
Adam SpriggsVictor CoreyEliot Harper Recent comment authors
newest oldest
Notify of
Eliot Harper

Very handy, thanks for sharing!

Victor Corey
Victor Corey

Does this function automatically pass context variables like subscriberID or ListID, etc or do you have to add those?