HubSpot Ideas


Provide identifier of original private page to access denied page

Currently, when some private content requires list membership, users that are not members of that list are redirected to the CMS access denied page (/_hcms/mem/denied), which is possible to customize through the use of a HubL template.


One key limitation in customizing that template is that there appears to be no way for the developer/designer to know which page the user had attempted to access that caused them to be redirected there.  Knowing the original page would be highly useful in tailoring the messaging and user experience on the access denied page, so it is possible to give accurate instructions for gaining access to the content they were seeking.


This information does not appear to be available through any of the documented HubL variables.  It also is not available in the HTTP Referer header, JavaScript document.referrer, or the contact's hs_analytics_last_url property because those contain only fully-rendered pages, and the page they attempted to access immediately redirects to the access denied page.


A simple solution for this would be to include the original page id as a query parameter to the access denied page redirect like:



This information would then be available to HubL through the request.query_dict object, as well as available to any JavaScript on the page.

1 Reply
HubSpot Employee

Definitely would be very beneficial to access this information!