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:
MicrositeURL()
RequestParameter()
Personalization Strings
Server-Side JavaScript