sweetysalesforce/ February 25, 2019/ CRM, Salesforce Marketing Cloud/ 0 comments

SFMC comes with default unsubscribe functionality which itself is smart enough to handle critical functionality of unsubscribe procedure, however the challenge here is that we cannot customize its unsubscribe page to give our users personalized and attractive landing page.

In order to overcome this limitation we can do create custom unsubscribe page using Web Studio.

Here is the method using which you can create custom Unsubscribe page for your Emails. You must be having your HTML page design ready to make below code work.

Below are the steps:

  1. Login to SFMC, go to Web Studio,
  2. Create HTML landing page.
  3. Include below ampscript code before html tag.
%%[
VAR @sid, @jid, @listid, @batchid, @reason, @lue, @lue_prop, @lue_statusCode, @overallStatus, @requestId, @lue_Response, @lue_Status, @lue_Error
SET @sid = IIF(Empty(RequestParameter(“email_address”)),RequestParameter(“current_email_address”),RequestParameter(“email_address”))
set @em = RequestParameter(“SID”)
SET @jid = RequestParameter(“JID”)
SET @listid = RequestParameter(“LID”)
SET @batchid = RequestParameter(“JSB”)
SET @reason = “Landing Page Unsubscribe”
SET @lue = CreateObject(“ExecuteRequest”)
SetObjectProperty(@lue,”Name”,”LogUnsubEvent”)
SET @lue_prop = CreateObject(“APIProperty”)
SetObjectProperty(@lue_prop, “Name”, “SubscriberID”)
SetObjectProperty(@lue_prop, “Value”, @em)
AddObjectArrayItem(@lue, “Parameters”, @lue_prop)
SET @lue_prop = CreateObject(“APIProperty”)
SetObjectProperty(@lue_prop, “Name”, “JobID”)
SetObjectProperty(@lue_prop, “Value”, @jid)
AddObjectArrayItem(@lue, “Parameters”, @lue_prop)
SET @lue_prop = CreateObject(“APIProperty”)
SetObjectProperty(@lue_prop, “Name”, “ListID”)
SetObjectProperty(@lue_prop, “Value”, @listid)
AddObjectArrayItem(@lue, “Parameters”, @lue_prop)
SET @lue_prop = CreateObject(“APIProperty”)
SetObjectProperty(@lue_prop, “Name”, “BatchID”)
SetObjectProperty(@lue_prop, “Value”, @batchid)
AddObjectArrayItem(@lue, “Parameters”, @lue_prop)
SET @lue_prop = CreateObject(“APIProperty”)
SetObjectProperty(@lue_prop, “Name”, “Reason”)
SetObjectProperty(@lue_prop, “Value”, @reason)
AddObjectArrayItem(@lue, “Parameters”, @lue_prop)
SET @lue_statusCode = InvokeExecute(@lue, @overallStatus, @requestId)
SET @lue_Response = Row(@lue_statusCode, 1)
SET @lue_Status = Field(@lue_Response,”StatusMessage”)
SET @lue_Error = Field(@lue_Response,”ErrorCode”)
]%%

This function will invoke the unsubscribe action. Save this page. It has a URL , copy that URL and add it as a link on your email template for Unsubscribe option.

You Unsubscribe page is ready.

Advertisements
Share this Post

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.