Loading

Posting Data to Account Engagement Through Hidden iFrames

Veröffentlichungsdatum: Sep 30, 2025
Beschreibung
Note: the process outlined below requires custom coding and falls outside the scope of Account Engagement Support. Account Engagement Support will not be able to assist troubleshooting these steps. 
Lösung
Below are details about the end-result your IT team or web developer should work toward when populating this iframe code. Here is an example of the code (written in PHP) you would put on the success or thank you page of your form (it can be placed anywhere on this page):

 

<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$zip = $_POST['zip'];
echo '<iframe src="https://www2.site.com/l/123/2009-04-28/ABCDE?first_name='.$first_name.'&last_name='.$last_name.'&email='.$email.'&company='.$company.'&phone='.$phone.'&zip='.$zip.'" width="1" height="1"></iframe>';
?>
The iframe src attribute is the same URL as for a form post to your form handler (which can be found by clicking “View form handler code”), only it is being called on a thank you page on your site with a one pixel height and width, making it nearly invisible to the prospect. The parameters appended to the src URL in your hidden iframe need to use the same external field names that are used in the form field mapping section of your form handler.
 
The resulting HTML on your form's success/thank you page should look something like this after a form submission:

 

<iframe src="https://www2.site.com/l/123/2009-04-28/ABCDE?first_name=John&last_name=Smith&email=john_smith@xyz.com&company=XYZ&phone=1234567890&zip=12345" width="1" height="1"></iframe>
For this 1×1 iframe, you will need to select Specific URL rather than Referring URL as the form handler's Success and Error Location fields, and then you can enter any URL except your form’s thank you page. You can use your homepage or any other page. The page at that URL will be loaded into the iframe, but it will not be visible. Additionally, you will want to add some extra Javascript or server-side scripting that only creates the Account Engagement iframe if the required fields are present. If the required fields are not present, the iframe should not be loaded.
 

Notes:

  • Nothing in your current form code will change. The sample code referenced above would only be placed on the success/thank you page of your existing form.
  • If a field is set as required in your form handler, be sure to make sure prospects always enter it (for example, require it in your web site’s form), otherwise the hidden form handler submission will fail.
  • If a prospect does not complete a required form field (or if that form field fails validation: for example, by entering text into a “numbers” form field), the prospect will be redirected to the Error Location with some messaging appended as parameters to the Error Location URL. Those parameters can then be read, either by a server side process or by JavaScript, to then be used to display some error messaging to the prospect. We therefore suggest editing your form fields ' error messages to include details that will identify the field(s) producing the error.
  • This method doesn’t automatically collect visitor cookie data or link it to the new prospect. This needs to be actioned manually. For more details, refer to this article.
Nummer des Knowledge-Artikels

000381972

 
Laden
Salesforce Help | Article