CloudPagesURL Function

The CloudPagesURL function allows you to pass personalization strings to a CloudPage in an encrypted string. A common use case is for custom preference pages.

Below are the parameters passed in CloudPagesURL. By using the AttributeValue function, you can retrieve these values for the parameters in your CloudPage.

  • Email Date Strings
    • xtmonth
    • xtmonthnumeric
    • xtday
    • xtdayofweek
    • xtyear
    • xtshortdate
    • xtlongdate
  • Email Data Strings
    • emailname_
    • _emailid
    • _messagecontext
    • _replycontent
    • _IsTestSend
    • jobid
    • _JobSubscriberBatchID
    • _PreHeader
    • _DataSourceName
    • _listname
  • Subscriber Data Strings
    • emailaddr
    • firstname_
    • firstname
    • lastname_
    • lastname
    • subscriberid
    • _subscriberkey
    • listid
    • list_
    • listsubid
    • _messagetypepreference
  • Sender Data Strings
    • replyname
    • replyemailaddress
    • memberid
    • member_busname
    • member_addr
    • member_city
    • member_state
    • member_postalcode
    • member_country

Example from Email:

For example, suppose you have a link from an email to your customer preference page hosted on a CloudPage. We are sending to a subscriber with the subscriber key of “003j000000Tn3su.” Using the CloudPagesURL function, this passes the _subscriberkey value in an encrypted string. In addition to the personalization strings, you can pass additional parameters included in the encrypted query string. For example, we will pass the segment name as an additional parameter:

					

%%[
set @SegmentName = ‘Purchased’
]%%
< a href="%%=RedirectTo(CloudPagesURL(12345,'SegmentName',@SegmentName))=%%">Click Here< /a>

Example on CloudPage:

The actual CloudPage URL will end in an encrypted string like: qs=02162df2db09a9fce04338dffea187d9af193d081e9210deadfe018711a19a386510aec056123330.

On the CloudPage, we use the AttributeValue function to retrieve the value for _subscriberkey and set it as the @subscriberKey variable.

					

%%[
set @subscriberKey = AttributeValue(_subscriberKey)
set @SegmentName = AttributeValue(‘SegmentName’)
]%%
%%=v(@subscriberKey)=%%
%%=v(@SegmentName)=%%

Output:

003j000000Tn3su
Purchased

Explanation:

The @subscriberKey variable in this example is a ContactId of “003j000000Tn3su” that we sent to in the email. The CloudPage picks up this value from the subscriber using the AttributeValue function. We are also passing the Segment Name as ‘Purchased’ which can also be retrieved from the encrypted string.

Any of the personalization string can be used in place of the _subscriberkey data attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *