Law firm marketing attribution: connecting clients back to keywords
Legal keywords are among the most expensive clicks on the internet. Personal injury terms routinely cost more than 50 dollars a click, and a firm spending 20,000 dollars a month on Google Ads is making a serious bet on which campaigns produce work.
Most firms cannot check that bet. The ad account reports conversions. The practice management system reports matters. Nothing joins them, so the campaign that produced three signed files and the campaign that produced thirty people who wanted free advice look identical.
Cost per lead is the wrong number
A firm running personal injury and family law together will see wildly different lead quality between them, and cost per lead will not show it. Family law enquiries are cheap and plentiful. Personal injury enquiries are expensive and rare, and one of them is worth more than a year of the other.
Optimise on cost per lead and you will shift budget toward the cheap campaign, which is exactly backwards. The number that matters is cost per signed matter, and calculating it requires knowing which marketing produced which matter.
That is the whole problem. Everything below is about closing that gap.
The chain you are trying to complete
Four links, and the third one is where firms lose it.
- Keyword to click. Google Ads knows this. It is in your account already.
- Click to visit. Handled if your ads carry tracking parameters.
- Visit to enquiry. The broken link. The intake form records a name and a phone number, and forgets everything about how the person arrived.
- Enquiry to matter. Your practice management system knows this, as long as your intake record carries through.
Fix link three and the chain completes. You can then ask which keyword produced signed work, which is a question almost no firm can currently answer.
Step one: make your ads carry the data
Google Ads auto-tagging adds a gclid to every ad click. Keep it on. It is what enables offline conversion imports later.
Auto-tagging alone will not give you the keyword in a readable form, so add a tracking template at the account level with UTM parameters as well:
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_term={keyword}&utm_content={creative} {keyword} returns the keyword that triggered the ad, which for a broad match campaign is not the same thing as what the person typed. That distinction matters more in legal than in most verticals, because broad match on “lawyer” terms pulls in an enormous amount of unrelated traffic. If you want the actual search query you will need the search terms report, which does not attach to individual leads.
Use {campaignid} rather than the campaign name. Names get edited, IDs do not, and a renamed campaign otherwise splits into two rows in your reporting.
Do the same for Microsoft Ads with msclkid and for Meta with fbclid if you run those.
Step two: capture it on the intake form
The visitor arrives with the data in the URL. Your form has to submit it.
Add a hidden input to your intake form for each value you want, then have something fill them in before submit:
<input type="hidden" name="lead_channel">
<input type="hidden" name="lead_campaign">
<input type="hidden" name="lead_keyword">
<input type="hidden" name="landing_page">
<input type="hidden" name="gclid"> Three things matter for legal sites specifically. Your intake form has to be on your own domain: a widget that loads inside a cross-domain iframe, which several legal intake products use, cannot be reached by a script on your page. If yours is an iframe, check whether the vendor offers a JavaScript embed instead, or ask them how to pass custom values into the widget.
Most legal traffic is also mobile, and most of it arrives with no UTM parameters at all, organic search, a bar association listing, a link from a local news story. Reading only the query string means you record nothing for a large share of your enquiries. Whatever fills the fields needs to fall back to the referrer, so an organic visit is recorded as organic search rather than as a blank.
And the person usually won’t fill in the form on the page they landed on. They land on a practice area page, read three more, then click Contact, and by then the values are already gone if you’re only reading the current URL. They have to be stored on arrival, in a first-party cookie, and read back at the form.
Step three: the seven day problem
This one deserves its own section because legal is where it bites hardest.
Safari limits cookies set by JavaScript to seven days. Outside the EU, every browser on iOS runs on WebKit and does the same, so that includes Chrome and Firefox on an iPhone. For a lot of law firms that is the majority of traffic.
Legal consideration periods are long. Somebody in a car accident does not choose a firm on the same afternoon. They read, they ask a friend, they come back a week or two later. If the cookie expired in the meantime, the first click is gone and they arrive in your intake system as Direct, which reads as “we have no idea” and quietly makes your organic and content marketing look worthless.
The fix is to set the cookie from a server rather than from JavaScript. Server-set cookies are exempt from the seven day cap and can persist up to 400 days. On WordPress that means PHP setting the cookie on page load, which also means excluding pages with forms from full-page caching so the PHP runs. On a static or hosted site, a Cloudflare Worker in front of the domain does the same thing.
If you take one technical detail from this article, take this one. It is the difference between attribution that works and attribution that looks like it works.
Step four: send signed matters back to Google Ads
This is the step that changes results rather than just reporting on them.
Once your intake records carry a gclid, you can export the enquiries that became signed matters, with their click IDs and a value, and upload them to Google Ads as offline conversions. Smart Bidding then optimises toward signed work instead of toward form fills.
The practical effect in a legal account is large. The campaigns that generate volumes of cheap unqualified enquiries stop being rewarded. Keywords that produce one expensive enquiry a fortnight, which happens to sign, start getting bid up.
Two constraints. The import window is limited, so a matter that takes six months to sign may fall outside it. And you need enough signed matters for the bidding to learn anything, which for a small firm can mean uploading a mid-funnel event, like “qualified consultation booked”, rather than the signature itself.
First touch and last touch are both worth keeping
Someone reads your article on what to do after a crash. Nothing happens. Eleven days later they type your firm’s name into Google and fill in the contact form.
Last touch says organic search on a brand term, which means your SEO agency claims it. First touch says the article, and the article is the reason the brand search ever happened. Both facts are true, and a system that records only one of them will point your budget at the wrong thing.
Keep both on the enquiry. First touch is written once and never overwritten. Last touch updates on any later visit that brings new information. Two extra fields on your intake record, and the argument about who gets credit becomes a data question.
Where this method stops
Phone calls are the biggest gap. A large share of legal enquiries begin with a call, and no form-based tracking sees them. Call tracking is a separate product with its own numbers pool, so if your firm runs mostly on phone intake, treat everything above as covering the form half of your enquiries and budget for call tracking separately.
Referrals and word of mouth show up as Direct, because that’s what they are. It’s an honest answer, and it stops you crediting a paid campaign for work that actually came from your reputation.
And attribution here is directional, not exact. People switch devices, clear cookies and browse in private windows, so nothing captures 100 percent of it. The goal is knowing that one campaign produces four times the signed work of another, not a number accurate to the dollar.
What to do on Monday
Add a source field to your practice management system and put it next to the phone number, where intake staff will see it without opening a report. Then wait a quarter and rank campaigns by cost per signed matter. Expect the order to change, and expect at least one campaign you were proud of to be near the bottom.
If you would rather not build the browser side, SourceTag does it: first click and last click in a first-party cookie, untagged traffic categorised by referrer, hidden fields filled on any form on your site, and a WordPress plugin or Cloudflare Worker for the Safari cookie problem. The field reference lists everything it can write onto an enquiry.
