Is there a way to capture the page URL of the page the user was on prior to them going to my CloudPage form and then use that as an input for the redirect after the form is submitted?


  • Please remember to mark my answer as accepted if it has been helpful Aug 20, 2022 at 10:34

1 Answer 1


You can access the referrer header, containing the url, using this Ampscript function:

SET @Referer = HTTPRequestHeader("Referer")

I would place the @referer variable in a hidden field, and pass it on upon submit, so the target page can redirect appropriately.


You must log in to answer this question.

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