I have been trying to figure out this use case, unfortunately without success:

A person logs into a portal (client's own portal, nothing to do with any of the Salesforce platforms) and they have the ability to manage their Marketing Cloud subscriptions.

There is no possibility to develop API calls - let's just say this must be a cost-effective solution, so we would like to include a Marketing Cloud Subscription Center link in the panel that the person sees after logging in. This link could be generated based on their Salesforce 18-digit ID or Email Address. The mysterious part is, how is the query string built and encrypted for use with Subscription Center?

I've been looking into the SFMC standard Subscription Portal links, and they all have a 128 character query string:


I suppose the query string must be the SubscriberKey or ID encrypted, but I wasn't able to decrypt it using any of the regular AMPscript functions.

The Subscription Center Link itself seems to contain a 64 character query string:

set @link = concat("%%subscription_center_url%%")
<a href="%%=RedirectTo(@link)=%%">click</a>


So basically, my question is, how do I generate a correct query string for use with the Standard Subscription Center, given that I have access to that person's 18-digit Salesforce ID or their Email Address?


OK, taking into account Johannes' and Don's comments, what would be a valid workaround?

I don't mind creating an automation to generate those links and update contacts/leads in Sales Cloud, so that every Contact/Lead has their own link that we can then feed to the external portal.

I am aware that this would not be a problem with a custom subscription centre, yet here we need to use the standard one.

  • 3
    My best guess is that you wont be able to generate that link outside of the sfmc. However I would look into a solution where you "generate" the links in a batch inside the sfmc and then export them to wherever you need them. Would that work?
    – DonL
    Dec 5, 2019 at 13:14
  • Thanks, both. Johannes, I was afraid that it might be what you suggested, a key that we will not be able to access. @DonL that could also work, can you think of a way to generate those in bulk, or to automate link generation? I could then automate it for ann new contacts/subscribers.
    – zuzannamj
    Dec 5, 2019 at 13:29

1 Answer 1


This is my understanding and I strongly believe that there shouldn't be any method to encrypt this method by yourself, otherwise there would be a security breach for salesforce.

I believe you will not be able to do it because you do not have the private encryption key and encryption method that salesforce uses to encrypt the data. Therefore you will not be able to encrypt this correctly. It is a security feature that you cannot decrypt that information, otherwise cloudpagesurl and other functions would expose sensible information which you could decrypt when you know the private key. I believe you have no chance at all to cover this.


I see multiple problems with a standard subscription center. It takes lots of data when you want good dataviews like unsubscribe or listsubscriptions. Some of them are JobID, SubscriberKey, SubscriberID, BatchID, ListID, .... all these data is usually inside the QS string. When you would then unsubscribe it takes these information to invoke a event to unsubscribe.

When you integrate the subscription-center-link into a cloudpage and add the qs parameter that has been created by a cloudpagesurl function inside an email for example, you can see that its working and transforming that qs parameter in a even different qs-parameter. Therefore it has to take some values (like the subscriberid or subscriberkey) from that qs parameter and generate the new subscription-centers there.

Storing those values of the subscription-centers will not help if you are interested in good data in your dataviews.

For my understanding there is no good way.


Off Solution: Adam Spriggs once answered my questions to a custom unsubscribe center, which you can visit here:

  • 1
    Ok one totally stupid method would be: You have the subscriber key -> do a send process with an email for that subscriber -> inside the email use a function to write into a dataextension and make use the value of %%subscription_center_url%% and store it with the subscriberkey. This has to run often to get all subscribers. Then export the dataextension with subscriberkey and the subscription center url and use it in the external system. Dec 5, 2019 at 16:03
  • 1
    The issue would be that each time it runs, it would have to count as an email send for it to correctly process the url. Which would completely blow through your supermessages very quickly. Dec 5, 2019 at 17:09
  • 2
    That could work - but do note that the url stored would be linked to that specific email job/list. Not that it would cause any issues with the user that I can foresee, but it may cause issues for analytics (e.g. click tracking) on your end. Also be sure to note the link expiration set in your account. I believe the Subscription Center follows this expiration policy as well. Dec 5, 2019 at 20:28
  • 1
    @zuzannamj - Just thought of this: you could include subscription_center_url as a field in your sendlog and then do a query to grab those values periodically and pass back to SalesCloud. This way you aren't reliant on a specific function being inside of every email Dec 8, 2019 at 21:05
  • 1
    Sounds much better than a function, thanks @Gortonington!
    – zuzannamj
    Dec 8, 2019 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.