I'm trying to use SSJS on a microsite landing page to pull in personalization strings and variables from an email. I tried using both the MicrositeURL() AMPscript function and the microsite_base_url personalization string as the account I'm working on is not 2.0.
The result of the below code are variables that are undefined.
Relevant email code:
<body>
%%[
VAR @var
SET @var = 1
]%%
<br><br>
Microsite URL: <a href="%%=MicrositeURL(825318)=%%" >this</a>
<br>
Microsite_base_url: <a href="%%microsite_base_url[default]825318[/default]%%" >this</a>
</body>
Here is the SSJS on the microsite page:
<script runat="server" language="javascript">
Platform.Load('Core', '1');
var subscriberkey = Variable.GetValue('_subscriberkey');
var emailaddress = Variable.GetValue('emailaddr');
var jobid = Variable.GetValue('jobid');
var batchid = Variable.GetValue('_JobSubscriberBatchID');
var listid = Variable.GetValue('listid');
var istestsend = Variable.GetValue('_IsTestSend');
var optoutflag = Variable.GetValue('@optoutflag');
</script>
<body>
<p>
SubscriberKey: <ctrl:var name=subscriberkey /><br>
EmailAddress: <ctrl:var name=emailaddress /><br>
JobID: <ctrl:var name=jobid /><br>
BatchID: <ctrl:var name=batchid /><br>
ListID: <ctrl:var name=listid /><br>
IsTestSend: <ctrl:var name=istestsend /><br>
OptOutFlag: <ctrl:var name=optoutflag /><br>
</p>
</body>
The body of the landing page spits out "undefined" for the variables.
SubscriberKey: undefined
EmailAddress: undefined
JobID: undefined
BatchID: undefined
ListID: undefined
IsTestSend: undefined
OptOutFlag: undefined
I am able to pull in these variables with AMPscript, so I may need to use AMP instead of SSJS if I can't figure this out.
Please help! Thank you.