Integrations

Attribute Pipedrive web forms

Carry the LeadJourney click ID through a Pipedrive web form so every submission is attributed to the exact campaign – the hidden lj_click_id field, the embed that silently drops it, and the trigger mapping on the LeadJourney side.

A Pipedrive web form submission becomes a lead in Pipedrive, and LeadJourney's Pipedrive integration turns that lead into a conversion. Without one extra field, though, LeadJourney can only match it by email – so a first-time visitor whose address it has never seen lands unattributed.

This page adds that field: a hidden lj_click_id that travels from the ad click into the form, and from there onto the lead.

In short

  1. Create a Text field called lj_click_id in Pipedrive and add it to the form as a hidden field.
  2. Put the click ID in the form's own URL – the standard embed will not do this for you.
  3. In LeadJourney, map the trigger's click_id to lj_click_id.

Before you start

  • Pipedrive is connected in LeadJourney – see Connect Pipedrive.
  • Tracking is live on the page that links to the form, so there is a click ID to pass on – see Install the tracking script.
  • Web Forms is part of Pipedrive's LeadBooster add-on, and setting them up needs the deals admin permission.

Step 1: Create the field in Pipedrive

In Pipedrive, go to Settings → Data fields → Leads/Deals and add a custom field:

  • Type: Text
  • Name: lj_click_id — exactly this, lower case, with underscores

The name matters because the form fills the field from the URL parameter of the same name.

Step 2: Add it to the form as a hidden field

Open Leads → Web Forms, open the form, add the lj_click_id field and switch on Hidden field. Visitors won't see it; it exists only to carry the value.

Repeat this for every form you want attributed. A form without the field still creates leads – they just arrive without a click ID.

Step 3: Get the click ID into the form's URL

This is the step that decides whether any of it works. The hidden field is filled from a ?lj_click_id=<id> parameter on the form's own URL.

The standard embed drops the click ID

Pipedrive's usual embed – the pipedriveWebForms div plus its loader script – renders the form in an iframe and does not forward the query string of the surrounding page. So putting ?lj_click_id=… on your landing page achieves nothing on its own: the parameter has to be on the URL the form itself is loaded from.

Both ways below need the visitor's click ID in the browser first. This helper reads it, with fallbacks for a blocked script – the full explanation is in Read and store the click ID:

async function getClickId() {
  try {
    const id = await window.lj?.getClickId();
    if (id) return id;
  } catch {}
  const fallbacks = [
    () => localStorage.getItem("clickId"),
    () => decodeURIComponent(document.cookie.match(/(?:^|; )clickId=([^;]*)/)?.[1] ?? ""),
    () => sessionStorage.getItem("clickId"),
    () => new URLSearchParams(location.search).get("lj_click_id"),
  ];
  for (const read of fallbacks) {
    try { const id = read(); if (id) return id; } catch {}
  }
  return null;
}

If the form sits on your page, build the iframe yourself instead of using Pipedrive's loader, so you control the src:

<iframe id="pd-form" title="Contact form" width="100%" height="700" frameborder="0"></iframe>

<script>
  getClickId().then((clickId) => {
    const src = new URL("https://webforms.pipedrive.com/f/YOUR-FORM-ID");
    if (clickId) src.searchParams.set("lj_click_id", clickId);
    document.getElementById("pd-form").src = src.toString();
  });
</script>

Take the form URL from Pipedrive's Share as link option – that's the same URL the loader would have used.

Height and resizing

Pipedrive's loader also resizes the iframe as the form grows. Building the iframe yourself means you set a fixed height instead, so leave enough room for the longest state of your form – including its validation messages.

Step 4: Submit the form once

LeadJourney's Web Form trigger list is built from forms that have been submitted recently – Pipedrive has no forms API to list them. Submit your form once, with a real value in the hidden field, so it appears in the next step.

Step 5: Create the trigger in LeadJourney

Open Settings → Apps → Pipedrive, click Add trigger and set it up:

  1. LeadJourney Event: the conversion this submission should record, typically Lead.
  2. Trigger: the Pipedrive web form event.
  3. Web Form: pick your form from the list.
  4. On Receive Data, click Find latest data and select the submission you just made.
  5. On Configure Mapping, point click_id at lj_click_id.

Save, and every later submission arrives tied to the click that produced it.

You don't need Pipedrive's field hash

Pipedrive sends custom fields under a 40-character hash rather than the field name, which would normally mean hunting for the right key. LeadJourney checks the values on the lead against the click IDs it knows for your workspace, recognises the match and offers it as a clean lj_click_id path in the mapping picker. Naming the field correctly in the form is all that's required.

Testing

Use a test ad URL or one from the UTM Builder so a click is recorded.

Check the form URL carries the ID

Click through to the form and look at the address – or at the iframe's src in the developer tools. It has to contain lj_click_id= followed by a UUID. If it doesn't, step 3 isn't doing its job and nothing after this will work.

Submit and check the lead

Submit the form, open the lead in Pipedrive and confirm that the lj_click_id field holds the value.

Confirm the attribution

In LeadJourney, open CRM → Leads and check that the new lead shows a source. The API Postbacks log shows whether the event matched on the click ID or fell back to the email.

Troubleshooting

The field stays empty on every lead

Almost always step 3. Check the form's own URL – not your landing page's URL – for ?lj_click_id=…. If you're using the standard pipedriveWebForms embed, it will never be there: that embed doesn't pass the parameter through.

Your form isn't in the Web Form list

The list only shows forms with a recent submission. Submit it once and reopen the trigger dialog.

The field is filled but click_id isn't offered in the mapping

LeadJourney surfaces lj_click_id once it can see a value that matches a click ID of your workspace. Make sure the submission you selected on Receive Data is one that actually carried the ID – an older test submission without it won't show the path.

Some leads have it, some don't

Expected, and not a bug: visitors who declined cookies, arrived with a blocked script, or reached the form through a link your snippet didn't rewrite have no click ID. Those leads are still created and can still be matched on email.

Common questions