[SalesForce] How to pass data to a Salesforce Marketing Cloud Smart Capture form via URL parameters

Not sure this is possible with Marketing Cloud Smart Capture form and landing pages, but seems like it should be.

I'm working with a client who has more than 50 locations. Their website(s) is a WordPress multi-site installation, with a site for each location.

Client wants to use a Smart Capture form on a landing page. Rather than create a landing page/form for each location, I'd like to pass the location name in the URL from the link on the WordPress location site to a single MC landing page.

Assuming I name the field in my data extension "Location", how would I build the URLs and how would I populate either the form field or the data extension record that's created from the form submit?

Best Answer

This is briefly explained in the Smart Capture documentation. In short, you will need to:

  1. Pass the location name as a URL parameter to the landing page, for example, http://pages.example.com?location=sydney
  2. Create a hidden form field in your Smart Capture form named 'location'
  3. Use the AMPscript RequestParameter() function to retrieve the value of the URL parameter.

Here is some sample code:

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

<!-- include in your form -->
  <input name="location" type="hidden" value="%%=v(@location)=%%" />

You will then create/update the 'location' Data Extension field with this hidden form field value.