There are some subtle differences between the functions to pass values from an email to a CloudPage.
NOTE: Be sure and test this functionality from your inbox. CloudpageURL doesn't pass context properly from send-preview.
If I use the following link to test the methods for passing parameter values
-- where field1
and OTP
are columns in my sending data extension containing the values whee!
and ABCD1234
respectively:
<a href="%%=redirectto(
concat(
CloudPagesURL(12345,
'value1', field1,
'value2', AttributeValue('field1')
),'&value3=',field1))=%%">cloudpagesurl</a>
And in my CloudPage:
value1 - naked personalization string
<br>AttributeValue: %%=AttributeValue("value1")=%%
<br>RequestParameter: %%=RequestParameter("value1")=%%
<br>QueryParameter: %%=QueryParameter("value1")=%%
<br><br>value2 - attributevalue
<br>AttributeValue: %%=AttributeValue("value2")=%%
<br>RequestParameter: %%=RequestParameter("value2")=%%
<br>QueryParameter: %%=QueryParameter("value2")=%%
<br><br>value3 - concat append
<br>AttributeValue: %%=AttributeValue("value3")=%%
<br>RequestParameter: %%=RequestParameter("value3")=%%
<br>QueryParameter: %%=QueryParameter("value3")=%%
<br><br>OTP - not explicitly passed
<br>AttributeValue: %%=AttributeValue("OTP")=%%
<br>RequestParameter: %%=RequestParameter("OTP")=%%
<br>QueryParameter: %%=QueryParameter("OTP")=%%
I get this output when I click on the link from my inbox:
value1 - naked personalization string
AttributeValue:
RequestParameter: whee!
QueryParameter: whee!
value2 - attributevalue
AttributeValue: False
RequestParameter: whee!
QueryParameter: whee!
value3 - concat append
AttributeValue:
RequestParameter: whee!
QueryParameter: whee!
OTP - not explicitly passed
AttributeValue: ABCD1234
RequestParameter:
QueryParameter:
Observations:
value1
: AttributeValue is empty since I'm not referencing the sending DE column name, but the parameter name. RequestParameter and QueryParameter have the same behavior.
value2
: AttributeValue is False
since I'm not referencing the sending DE column name, but the parameter name is set with AttributeValue in the email. RequestParameter and QueryParameter have the same behavior.
value3
: AttributeValue is empty since I'm not referencing the sending DE column name, but the parameter name. RequestParameter and QueryParameter have the same behavior.
OTP
: You don't actually explicitly pass parameters in the CloudPagesURL function if they're part of your send context. They'll show up automatically and can be referenced using AttributeValue.
Key takeaway:
- Save some typing in your email, just retrieve the contextual values using AttributeValue.
Reference: