Is there a way to return the full URL -- including any hash values using Server-Side JavaScript in a Landing/Cloud Page in Marketing Cloud ?

If the incoming URL to my page is:


The Platform.Request.RequestURL doesn't return any hash values:

<script runat="server">





The Platform.Request.QueryString doesn't include it either:

<script runat="server">





Anyone know?


Judging from a bit of research, it doesn't appear to be possible to gather anything with a hash (#) on the server-side as these are not actually provided to the server, only client-side.

But /#id=5 is not sent to server with request by the browser, so there is no way to get that value on server side, and you can do nothing about it since it is the browser decided not to send this data and you don't have it on server side.


What you likely would have to do is collect the URL via SSJS and then have a client-side JS function to collect the Hash values. From there, depending on what you need it for, you can save this value (in a DE, a cookie, etc) and pull it on the next server load.

Another option is if you control the refferer page is to run a script to add this hash value as a form post and post to the new page where you can then combine the hash and the url to get your hashed URL.

This is very clunky, but it doesn't appear there is a way to gather this info Server Side at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.