I'm using some ampscript to set a variable to pull record information in from a Data Extension based on their contactKey
. I've done this several times before (different marketing cloud instance).
/* Get the key */
set @subKey = AttributeValue("_subscriberkey")
/*if empty, pull from different param in URL*/
if empty(@subKey) then set @subKey = AttributeValue("sk") endif
/*if empty, pull from form field*/
if empty(@subKey) then set @subKey = requestparameter("_subscriberkey") endif
The 1st one is based on the qs code generated from an email (truest form)
The 2nd should pull from the URL parameter (ie. whatever.com/preference?sk=123) <-- this is the one that I utilize for testing since I can just write in a matching contactKey
.
I can't seem to even get the page to populate a personalization string for testing on the second option.
Using this:
Test: %%=v(@subKey)=%%
Even if I strip out ALL other ampscript block code to just this:
/*if empty, pull from different param in URL*/
set @subKey = AttributeValue("sk")
I can't get it to populate. Did something change with Marketing Cloud's handling of URL parameters? I'll add that this page is not secure (no SSL cert) - but even still, I've done this without a secure page before.
if empty(@subKey) then set @subKey = AttributeValue("sk") endif
withif empty(@subKey) then set @subKey = requestparameter("sk") endif
. It appears to be functioning...odd that using the AttributeValue works in all my other instances