2

I need to make a Custom Preference Page (for the Cloud Marketing). I know that on the Standard Preference Page you use the "QS" value in the URL, and that it is used to fetch the Preferences from the Subscriber.

My questions are:

  1. How can I get this QS?

  2. How can I get the preferences of the Subscriber after having the QS on the Custom Preference Page?

In short, I need to replicate the Standard behavior.

1 Answer 1

3

You would create the a cloud page in web studio and link it to the email via the CloudPageURL Function. The beauty of this is it encryts subscibers context data (e.g subscriberkey, emailaddress). You can also pass additional data as attributes within the function.

On the cloud page, you would retrieve the parameters using the RequestParameter Ampscript Function

Example:

  • I create a Cloud Page and get it ID ("111")number by checking the pages properties
  • The Cloud Page needs to use SubscriberKey for some logic (eg. Retrieve a value from salesforce)
  • I add @Redirect(CloudPagesURL("111") to the CTA in my email.
  • On the Cloud Page I add the following code

     %%[
    var @SusbcriberKey
    
    SET @SubscriberKey = RequestParameter("_subscriberKey")// for subscriber context data, you have to use personalisation strings
    
    ]%%
    
    %%=v(@SubscriberKey)=%%
    

The subscriberKey would now be available as a Parameter on the cloud page

Update

From your comments, SSJS seems to be your preferred route. The logic behind the email still stands, but you would have to retrieve the values differently

<script runat="server" language="javascript">
Platform.Load("core","1");
   set SubKey =  Attribute.GetValue("_subscriberkey");
</script>

Reference:

7
  • Hi, thanks for your answer. I continue with a doubt. How can I get the Subscriber data from the encrypted parameter in the Cloud Page? var myDE = DataExtension.Init('XXX'); var filter = {Property: 'ID', SimpleOperator:'equals', Value:"the_encrypted_parameter"}; var data = myDE.Rows.Retrieve(filter);
    – Mendes
    May 15, 2018 at 20:15
  • I have walked you through it above. Its slightly different if you are using SSJS
    – 0xsegfault
    May 15, 2018 at 20:18
  • @user56220 that the magic of the CloudPagesURL. IF you use the RequestParameter or GetValue calls., it will automatically decipher them
    – 0xsegfault
    May 15, 2018 at 20:28
  • Black magic! But it worked. Thank you, I did not know this magic trick. He was now using it again to make the data submit to be recorded. (Or is there something I need to keep in mind?)
    – Mendes
    May 15, 2018 at 21:08
  • Hi, man. How are you? Im trying to get the SubKey via AMPScript just like you said but isn't working :(
    – Mendes
    May 24, 2018 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .