Pipedrive
Pipedrive is a sales CRM platform focused on pipeline management, deal tracking, and sales automation. Pipedrive’s Web Forms feature lets you embed lead capture forms on your website that create contacts and deals directly in your Pipedrive pipeline.
Pipedrive Web Forms render as standard HTML <form> elements on the page, so AttributionHub’s standard forms handler detects and populates them automatically. You just need to add hidden fields to capture attribution data alongside your regular form fields.
Prerequisites
Before you begin, make sure:
- The AttributionHub tracking script is installed on your site (see Installation)
- You have a Pipedrive account with access to create or edit Web Forms
- You have access to your website’s code or CMS to embed the form
Step 1: Create Custom Fields in Pipedrive
Before you can capture attribution data, you need custom fields in Pipedrive to store it. These can be on the Person, Organization, or Deal object.
- In Pipedrive, go to Settings (gear icon) > Data fields (under “Company settings”)
- Select the object type where you want the attribution data (typically Person or Deal)
- Click Add custom field
- For each attribution field:
- Set the Field name to something descriptive (e.g., “Attribution Channel - Latest”)
- Set the Field type to Text
- Note the field’s API key (Pipedrive generates one automatically, e.g.,
abc123_attribution_channel)
- Click Save and repeat for each field
Step 2: Add Custom Fields to Your Web Form
- In Pipedrive, go to Tools & Apps > Web Forms (or LeadBooster > Web Forms depending on your plan)
- Open the form you want to edit, or create a new form
- In the form builder, click Add field
- Add each custom field you created in Step 1
- For each attribution field, toggle it as a hidden field (if the Web Forms builder supports this), or configure it to not be visible to visitors
Note: Pipedrive Web Forms’ hidden field support varies by plan and version. If hidden fields are not available in the form builder, you may need to add them manually to the embed code. See Adding Hidden Fields to the Embed Code below.
Step 3: Embed the Form on Your Page
Use Pipedrive’s embed code on your website:
<!-- Pipedrive Web Form embed -->
<div
class="pipedriveWebForms"
data-pd-webforms="https://webforms.pipedrive.com/f/XXXXXX"
>
<script src="https://webforms.pipedrive.com/f/loader"></script>
</div>AttributionHub detects Pipedrive forms by looking for standard form elements, as well as the Pipedrive-specific selectors:
form[action*="pipedrive.com"].pipedrive-form
Adding Hidden Fields to the Embed Code
If the Pipedrive form builder does not support hidden fields, you can add them manually after the form renders. Add a script that injects hidden inputs:
<script>
// Wait for Pipedrive form to render, then add hidden fields
const observer = new MutationObserver(() => {
const form = document.querySelector('form[action*="pipedrive.com"]');
if (form && !form.querySelector('[name="ah_lt_channel"]')) {
const fields = [
"ah_lt_channel",
"ah_lt_source",
"ah_lt_medium",
"ah_lt_campaign",
"ah_lt_landing_url",
"ah_ft_channel",
"ah_ft_source",
"ah_visitor_id",
];
fields.forEach((name) => {
const input = document.createElement("input");
input.type = "hidden";
input.name = name;
form.appendChild(input);
});
}
});
observer.observe(document.body, { childList: true, subtree: true });
</script>AttributionHub’s standard handler will then detect and populate these hidden fields.
Step 4: Test the Integration
- Visit a page on your site that contains the Pipedrive form
- Open your browser’s DevTools (F12)
- Inspect the form element and check the hidden
<input>elements for attribution values - Submit a test entry with a test email address
- In Pipedrive, find the new contact or deal created by the form submission. Check the custom fields for attribution values
For a full testing walkthrough, see Verify It Works.
Recommended Hidden Fields
The table below lists the most commonly used fields. For the complete field catalog, see Field Reference.
Core Attribution Fields (Latest Touch)
| Field Name | Description | Example Values |
|---|---|---|
ah_lt_channel | Channel group (latest touch) | Paid Search, Organic Social, Direct |
ah_lt_source | Traffic source name | Google, Facebook, Direct |
ah_lt_medium | Traffic medium | paid, organic, social, email |
ah_lt_campaign | Campaign name | spring_sale, Organic Search |
ah_lt_landing_url | Landing page URL (no query string) | https://yoursite.com/pricing |
Core Attribution Fields (First Touch)
| Field Name | Description | Example Values |
|---|---|---|
ah_ft_channel | Channel group (first touch) | Paid Search, Organic Social |
ah_ft_source | Traffic source name | Google, Facebook |
ah_ft_campaign | Campaign name | launch_campaign |
Global Fields
| Field Name | Description | Example Values |
|---|---|---|
ah_visitor_id | Unique visitor ID, persistent across visits | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
For additional fields including latest-non-direct touch (
ah_lnd_*), drill-down fields, raw UTM parameters, and ad click IDs, see the full Field Reference.
Custom Field Mapping
If your Pipedrive custom fields use Pipedrive’s auto-generated API keys, map AttributionHub’s internal paths:
<script>
window.attrhub = {
settings: {
fieldMapping: {
"latest.attribution.channelGroup": "abc123_attribution_channel",
"latest.attribution.source": "abc124_attribution_source",
"latest.attribution.campaign": "abc125_attribution_campaign",
},
},
};
</script>Replace the API keys with the actual keys from your Pipedrive custom fields. See Configuration for the full mapping reference.
Tips
- Pipedrive Insights — Use Pipedrive’s revenue reports and Insights dashboards to analyze which attribution channels generate the most deals and revenue.
- Workflow automations — Create Pipedrive workflow automations that trigger based on attribution field values. For example, automatically assign deals from “Paid Search” to your top closer.
- Deal tracking — When a Web Form creates a deal in Pipedrive, the attribution custom fields tell you exactly which marketing channel sourced the opportunity.
- Pipedrive + Zapier — If you use Zapier to connect Pipedrive with other tools, attribution fields are available in the Zapier trigger data for routing or enrichment.
- LeadBooster chatbot — If you use Pipedrive’s LeadBooster chatbot, note that chatbot forms are isolated and may not be covered by the standard handler. Web Forms are the recommended integration point for attribution.
Troubleshooting
Custom fields are empty after form submission
- Verify that the hidden field
nameattributes match either the default field names or your customfieldMappingconfiguration. - Check that the Pipedrive Web Form actually renders as a
<form>element in the DOM (some versions render differently). - If the form loads dynamically (via JavaScript), AttributionHub’s MutationObserver should detect it. Check the Console for detection messages.
- Enable logging (
enableLogging: truein settings) and check the browser Console.
Form not detected
If the Pipedrive form uses a non-standard container, add it to the form selectors:
window.attrhub = {
settings: {
formSelectors: [".pipedriveWebForms form", 'form[action*="pipedrive.com"]'],
},
};Web Form renders in an iframe
Some Pipedrive embed methods use iframes. If the form is inside an iframe, the standard handler cannot access it. Check your embed code and prefer the inline (non-iframe) embed method.