1

When I use CloudPagesURL function with no paramenters except the Id i don't have any issues.

Case 1

<p><a title="MyPage" href="%%=CloudPagesURL(232)=%%" alias="ThisAlias" conversion="false">RSVP</a></p>

When I use CloudPagesURL with additional parameters other than ID i get

Error : 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Case 2

%%[
set @sk = _subscriberkey
]%%

<p><a title="MyPage" href="%%=CloudPagesURL(232,'sk',@sk )=%%" alias="ThisAlias" conversion="false">RSVP</a></p>

Now this is where things get intresting if i wrap around the above code with redirectto() function everything works fine.

Case 3

%%[
set @sk = _subscriberkey
]%%


<p><a title="MyPage" href="%%=RedirectTo(CloudPagesURL(232,'sk',@sk ))=%%" alias="ThisAlias" conversion="false">RSVP</a></p>

Question: Is this behavior a bug in CloudPagesURL function or Am I missing something?

1 Answer 1

5

According to documentation, CloudPagesUrl should always be wrapped in RedirectTo

<p><a title="MyPage" href="%%=RedirectTo(CloudPagesURL(77777,foo,@bar))=%%" alias="ThisAlias" conversion="false">Click to unsubscribe</a></p>

Any reason for you wanting to avoid this?

5
  • Honestly it doesn't explicitly say that! I never assumed that was a requirement as the rest of the examples were not wrapped. Nov 16, 2018 at 18:24
  • 1
    The other examples on the page are not shown in a context of an ‘a href’-tag. They will print the CloudPageUrl in the text, but might not work in links. Again: I will always recommend it as best practice to wrap any URL, regular or CloudPageUrl in RedirectTo. I can’t see why you are trying to avoid this - if it proves to be working for you. Nov 16, 2018 at 19:44
  • Thanks! My only complaint is the document could be more clearer! Nov 16, 2018 at 19:45
  • I second that. You can also find several posts here on SFSE, where this issue is being discussed. Nov 16, 2018 at 19:47
  • 1
    if I may - I think the part that is exceptionally confusing here is when you use Content Builder to create a link to a Cloud Page, Marketing Cloud itself doesn't use the RedirectTo()... href="%%=CloudPagesURL(2588)=%%" It seems strange to me that you should have to manually go in and wrap each link created this way with a "RedirectTo()". Am I missing something here @LukasLunow? ;) Dec 3, 2020 at 13:53

You must log in to answer this question.

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