In an email, I want to redirect to a custom profile center page, is there a way to change the value of the %%profile_center_url%%
so that it goes to a custom page instead of the default?
3 Answers
SFMC Support can change the value for the %%profile_center_url%%
to whatever you want -- as @Kenneth mentioned.
I typically do this, which I outline here:
<a href='%%=MicrositeURL(888888,"subscriberMID", "12345678")=%%'>Update Profile</a>
Then in the profile center page:
<script type="text/javascript" runat="server">
Platform.Load("core", "1.1.1");
</script>
%%[set @subscriberMID = RequestParameter("subscriberMID")]%%
<script type="text/javascript" runat="server">
if (Variable.GetValue("@subscriberMID") != "") {
memberid = Variable.GetValue("@subscriberMID");
} else {
memberid = Attribute.GetValue("memberid");
}
</script>
Same thing can be done with the CloudPagesURL() function.
Update
Since the CloudPagesURL() doesn't do URL parameters properly, here's my preferred way of doing this with the CloudPagesURL() function:
<a href='%%=redirectto(concat(CloudPagesURL(1234),"&mid=", memberid))=%%'>Preference Center</a>
Then in SSJS:
SetVar("mid", Request.GetQueryStringParameter("mid"));
function SetVar(varName, varValue){
request[varName] = varValue ? varValue : "";
Variable.SetValue(varName, varValue);
}
-
Why you choose SSJS over AmpScript for your preference centers? Commented Jun 16, 2017 at 11:55
-
1
-
Ever since I read the post by @AdamSpriggs, I have used the MicrositeURL function. It's awesome. Commented Jul 24, 2017 at 18:53
-
Thanks ! In the global MC Footer I the redirectTo doesn't seem to work (the URL that appears in the email is user-content.s50.sfmc-content.com/%%=RedirectTo ..) Is it necessary to not use the Company footer but instead to define one in a template ? Commented Dec 16, 2020 at 17:09
I would advise the following:
- Building the preference center in Cloud pages and use the CloudPagesURL function to form the redirect link. This has the added advantage of encrypting subscriber information. No
- Normally not using the default profile center link would throw an error. This can by bypassed by either still including it and hiding the link, or contacting your account executive .
- You can also use the Ampscript below to hack it:
%%[ if 0 == 1 then ]%%%%profile_center_url%%%%[endif]%%
We can't change system generated %%profilecenterurl%% to update profile that gives preview error,but if we want to navigate to custom page profile center LP/Cloud page URL u need to mask the system generated profile center.
Below way we can do it
step 1 : Hide System Generated Profile center using css property
[a style="display:none;" href="%%profile_center_url%%" alias="Update Profile"]
Step 2 : Add one more href and redirect to your custom profile center landing page.
[a href="https://pub.s7.exacttarget.com/s3o0c2hx33i" alias="Update Profile"]
Hope this works for you too.
-
1Have you reached out to support? They can disable these validations for you, so you do not need to hide anything. Also, i believe that they might also be able to change the URL to the profile center at a system level? Commented Jun 16, 2017 at 8:38
-
Using the raw URL for a custom preference center is leaving out all of the benefits of the subscriber context you get with the cloudpagesurl() and micrositeurl() functions. Commented Jun 16, 2017 at 11:36