[SalesForce] Pre-Populate a Smart Capture Form in Salesforce Marketing Cloud

I'm doing a smart capture form on cloud pages to update some interests of my subscribers. I created a new data extension with this fields. I want to send an "Update interest" Email which redirect to the landing page with this form.

I want the form to pre-populate and take the email of the user that clicked, so the contact don't type it again.

I tried this:

On the email:

URL/?asoc=CRM&%%email%%

On the landing page:
I create a hidden field: email. And on a text block I used:

%%[ var @email set @email = RequestParameter("email") ]%%

and on the form:

<input name="email" type="hidden" value="%%=v(@email)=%%">

It didn't work.

Do I need to ask some other information? Or use another request parameter?

I read this: https://help.salesforce.com/articleView?id=mc_es_pre_populating_smart_capture_fields_with_salesforce_data.htm&type=5 and I don't get the "Contact_Owner_ID" thing.

Can someone help me?

Regards.
Alma.

Best Answer

In your email URL, you will need to assigning the parameter called 'email' and then apply the value like so :

URL/?asoc=CRM&email=%%email%%

However, I'm not 100% certain a SmartCapture form will be able to execute AMPScript in a text block. Personally I don't use SmartCapture and would typically build a custom cloud page, in which case the RequestParameter() function would work as you document - but you need to add email= as a parameter tag to your URL

%%[ var @email set @email = RequestParameter("email") ]%%

Some words of advice / best practice however - in your solution, you intend to pass a raw/visible email address in the URL. This isn't a recommended practice as it's publicly visible. Also labelling the parameter 'email' wouldn't be advisable as it's clear what the expected value will be.

Ideally you should encrypt your email address (or any PII data), then apply it to the URL. On the Cloud Page you would then decrypt it etc. The reason for being security conscious is for example, if a customer clicked on a link at an Internet Cafe, their PII data is easily visible in Proxies etc.

Another (easier) alternative would be to use the CloudPagesURL() function, which you can then pass the values securely/encrypted to the could page and then retrieve the values using the RequestParameter() function

View the CloudPagesURL() technical here

Related Topic