[SalesForce] Landing Page Dynamic Content when Accessed through a Push Message

I am trying to access dynamic content within a Cloud Page landing page when the landing page is sent through as a Mobile Push message.

My goal would be to use DeviceId as a lookup to other data extensions which will in turn allow me to populate the landing page with dynamic content.

For example, if I put the following into a landing page, I would expect to be able to dynamically get the end user's first name:

%%[VAR @fname SET @fname=Lookup("Customer_demo", "first_name", "DeviceId", DeviceID)]%% 

Hello %%=v(@fname)=%%! 

When delivered through Mobile Push, I get a 500 error. If, however, I do the same type of lookup and send it as an alert through Mobile Push, it will work as expected.

Is there a way to pass a parameter to a landing page through a Mobile Push message?

Best Answer

I don't believe %%DeviceID%% is able to be used on Landing Pages.

If you have the customer's DeviceID on record, you can incorporate the DeviceID into the Landing Page URL as a parameter:

%%[
VAR @landingpage, @deviceid, @messageURL
SET @landingpage = "https://pub.exacttarget.com/myLandingPage"
SET @deviceid = Lookup("Customer_demo", "DeviceId", "SubscriberKey", SubscriberKey)
SET @messageURL = concat(@landingpage,'?devID=',@deviceid)
]%%
%%=v(Redirect(@messageURL))=%%

And then retrieve the DeviceID (devID) on the Landing Page using the following:

%%[
VAR @fname,@deviceID
SET @deviceID = QueryParameter("devID")
SET @fname = Lookup("Customer_demo", "first_name", "DeviceId", @deviceID)
]%% 
Hello %%=v(@fname)=%%! 

Reference: QueryParameter

If you are concerned about passing readable DeviceIDs that people could alter, you could use Base64Encode and Base64Decode to encode the information so it's less readable.

Passing a 2nd validation value - such as SubscriberKey - would further secure your landing page.

Related Topic