0

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?

1 Answer 1

3

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.

1
  • We are having the issue that the Content Builder somehow adds spaces between value="%%=v(@location)=%%." It then looks like this in the HTML editor: value=" %%=v(@location)=%%" Is anyone else experiencing this issue and know how to solve that? Dec 20, 2016 at 11:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .