1

I'm trying to retrieve parameter that I passed with MicroSiteURL() on Landing Page I created. I tried multiple approaches
URL:

MicroSiteURL(10000, "oneClickUnsubscribe", "true")

Code:

%%[
var @oneClickUnsubscribe
set @oneClickUnsubscribe = QueryParameter('oneClickUnsubscribe')
]%%
<script runat="server">
Platform.Load('core', '1');
Write(Attribute.GetValue('oneClickUnsubscribe') + ': Attribute.GetValue<br>');
Write(Platform.Request.GetCookieValue('oneClickUnsubscribe') + ': Platform.Request.GetCookieValue<br>');
Write(Platform.Request.GetFormField('oneClickUnsubscribe') + ': Platform.Request.GetFormField<br>');
Write(Platform.Request.GetQueryStringParameter('oneClickUnsubscribe') + ': Platform.Request.GetQueryStringParameter<br>');
Write(Platform.Variable.GetValue('@oneClickUnsubscribe') + ': Platform.Variable.GetValue<br>');
</script>

Only option that works for me is the last one. Is there a way to do it just with SSJS?

2 Answers 2

6

I've found that you can only retrieve that using the RequestParameter() AMPScript function.

Here's an example:

<script type="text/javascript" runat="server">

Platform.Load("core", "1.1.1");  

// other code
  
</script>
%%[
set @oneClickUnsubscribe = RequestParameter("oneClickUnsubscribe")
]%%
<script type="text/javascript" runat="server">
  
var oneClickUnsubscribe = Variable.GetValue("@oneClickUnsubscribe");
  
// other code

</script>
0
7

actually as long as the parameter shows up in the URL (=GET parameter) this does work:

<script runat="server">

// call page like: url.com/cloudpage?data=test

Platform.Load("core", "1.1.1");

var param = Request.GetQueryStringParameter("data");
Write(param);
// returns "test"

</script>

You must log in to answer this question.

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