#Overview
Using WP Fusion and Document Library Pro (by Barn2), you can automatically sync lead capture form submissions to your CRM and apply tags on a per-document basis when visitors download documents.
For logged-in WordPress users, the data is synced to their existing CRM contact record. For guests, WP Fusion will look up the email address in your CRM and update the existing contact, or create a new one if no match is found.
#Lead Capture
When a visitor submits a lead capture form in Document Library Pro, WP Fusion will automatically sync the submitted data to your CRM. This includes the visitor’s name, email address, the document title(s) and URL(s) they downloaded, and their privacy consent status.
No additional configuration is needed — as long as lead capture is enabled in Document Library Pro’s settings and WP Fusion is active, submissions will be synced automatically.
#Per-Document Tagging
You can configure tags to be applied in your CRM when a specific document is downloaded via the lead capture form. To set this up, edit any document in Document Library Pro and look for the WP Fusion – Lead Capture meta box in the sidebar.
Tags specified in this meta box will be applied to the contact in your CRM whenever someone submits the lead capture form to download that document.
#Syncing Meta Fields
The following fields are available for sync under the Document Library Pro field group in the WP Fusion settings (under Contact Fields):
- Document Title — The title(s) of the downloaded document(s), comma-separated if multiple.
- Document URL — The URL(s) of the downloaded document(s), comma-separated if multiple.
- Privacy Consent — The visitor’s privacy consent response from the lead capture form.
These are send-only fields — they are synced to the CRM when the lead capture form is submitted but are not loaded back from the CRM.
#Developer Resources
#wpf_dlp_lead_capture_data
This filter lets you modify the data that WP Fusion syncs to the CRM when a Document Library Pro lead capture form is submitted.
function my_custom_dlp_data( $update_data, $lead_data ) {
// Add a custom field from the raw lead data.
$update_data['company'] = ! empty( $lead_data['company'] ) ? sanitize_text_field( $lead_data['company'] ) : '';
return $update_data;
}
add_filter( 'wpf_dlp_lead_capture_data', 'my_custom_dlp_data', 10, 2 );
Parameters:
$update_data(array) — The data to be synced to the CRM. Keys includefirst_name,last_name,user_email,dlp_document_title,dlp_document_url, anddlp_privacy_consent.$lead_data(array) — The raw lead capture data from Document Library Pro, including thedocumentsarray.
