Skip to Content

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.

  1. In Pipedrive, go to Settings (gear icon) > Data fields (under “Company settings”)
  2. Select the object type where you want the attribution data (typically Person or Deal)
  3. Click Add custom field
  4. 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)
  5. Click Save and repeat for each field

Step 2: Add Custom Fields to Your Web Form

  1. In Pipedrive, go to Tools & Apps > Web Forms (or LeadBooster > Web Forms depending on your plan)
  2. Open the form you want to edit, or create a new form
  3. In the form builder, click Add field
  4. Add each custom field you created in Step 1
  5. 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

  1. Visit a page on your site that contains the Pipedrive form
  2. Open your browser’s DevTools (F12)
  3. Inspect the form element and check the hidden <input> elements for attribution values
  4. Submit a test entry with a test email address
  5. 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.

The table below lists the most commonly used fields. For the complete field catalog, see Field Reference.

Core Attribution Fields (Latest Touch)

Field NameDescriptionExample Values
ah_lt_channelChannel group (latest touch)Paid Search, Organic Social, Direct
ah_lt_sourceTraffic source nameGoogle, Facebook, Direct
ah_lt_mediumTraffic mediumpaid, organic, social, email
ah_lt_campaignCampaign namespring_sale, Organic Search
ah_lt_landing_urlLanding page URL (no query string)https://yoursite.com/pricing

Core Attribution Fields (First Touch)

Field NameDescriptionExample Values
ah_ft_channelChannel group (first touch)Paid Search, Organic Social
ah_ft_sourceTraffic source nameGoogle, Facebook
ah_ft_campaignCampaign namelaunch_campaign

Global Fields

Field NameDescriptionExample Values
ah_visitor_idUnique visitor ID, persistent across visitsa1b2c3d4-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

  1. Verify that the hidden field name attributes match either the default field names or your custom fieldMapping configuration.
  2. Check that the Pipedrive Web Form actually renders as a <form> element in the DOM (some versions render differently).
  3. If the form loads dynamically (via JavaScript), AttributionHub’s MutationObserver should detect it. Check the Console for detection messages.
  4. Enable logging (enableLogging: true in 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.