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?
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
This is briefly explained in the Smart Capture documentation. In short, you will need to:
- Pass the location name as a URL parameter to the landing page, for example, http://pages.example.com?location=sydney
- Create a hidden form field in your Smart Capture form named ‘location’
- 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.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0