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?

5

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>
2

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

// call url.com/cloudpage?data=test

<script runat="server" language="JavaScript">
  Platform.Load("core", "1.1.1");

  var param = Request.GetQueryStringParameter("data");
  Variable.SetValue("@output", param);
</script>
(%%=v(@output)=%%)
// returns "(test)"

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.