Get UTM parameters into Microsoft Dynamics 365 from your website forms
If your ads and organic pages send traffic to a website form, the campaign data behind that visit can travel with the lead into Microsoft Dynamics 365. The setup is a short chain: a script on the site, six hidden fields on the form, automatic population of those fields, and a transfer step into Dynamics 365. Once the data lands, you can report on which channels and campaigns produce leads, customers and revenue — not just visits.
What the setup actually does
A visitor arrives from a campaign link, a search result, a social post or a direct visit. A small script on the site reads how they got there and sorts them into a standard marketing channel, keeping that classification in the browser. When the visitor later submits a form, the classification and related details are written into hidden fields and captured by the form tool alongside the contact details. From the form tool, the values move into Microsoft Dynamics 365 through a native integration or a connector such as Zapier or Make. The tracking layer described here is a third-party attribution script; if you use a different tool, confirm it offers the same channel classification and browser-side persistence before following the field map below.
The four steps
- Place the tracking script on the website. Most site builders — WordPress, Webflow, Squarespace and similar — allow this through their settings area; platform-specific installation guides exist for the major builders.
- Add six hidden fields to each lead-capture form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page and Landing Page Group. In form builders such as Gravity Forms, WP Forms or Typeform, a hidden field type can be dragged into the form.
- Let the script fill those fields automatically on each submission, using the UTM parameters attached to the campaign.
- Pass the captured values into Microsoft Dynamics 365 through the form tool's integration or a connector, then build reports on top of them.
Field map: what each hidden field holds
Use this as a build checklist when wiring the form to Dynamics 365. The field names must match exactly so the script can write into them.
Worked example: a paid-search demo request
Picture a B2B software company running a paid search campaign for its analytics product. A marketer searches Google for "marketing attribution software," clicks the ad, reads a couple of product pages, and then submits a demo request form. The UTM parameters on that ad would populate the hidden fields like this:
- Channel = Paid Search
- Channel Drilldown 1 = Google
- Channel Drilldown 2 = Attribution Launch Campaign
- Channel Drilldown 3 = Attribution Demo Ad
- Landing Page = www.exampleanalytics.com/product/attribution
- Landing Page Group = Product
The landing page values reflect the first page the visitor arrived on, not the page where the demo form was submitted.
Why channel-normalized capture beats raw UTM strings
Tools that only copy raw UTM strings into the CRM leave gaps. Three distinctions matter when you choose an approach.
- Coverage of non-paid traffic. Raw UTM capture only sees visitors who arrived with UTM parameters, which usually means paid campaigns. A channel-normalized approach also classifies Organic Search, Organic Social, Direct traffic, Referral and other sources, so every lead has a source.
- Persistence across pages and sessions. If the tracking only works on the landing page, a visitor who browses elsewhere before submitting loses the data. Storing the classification in the browser at arrival keeps the original attribution intact regardless of where the form is completed.
- Click IDs for offline conversion feedback. Capturing Google Click ID (GCLID), Microsoft Click ID (MSCLKID) and Facebook Click ID (FBCLID) lets you send customer-level outcomes back to the ad platform as offline conversions, so campaigns can be optimized around paying customers rather than form fills.
Landing page and subdirectory data
Alongside channel data, the script records the landing page URL and its subdirectory. A visitor who first arrives on a blog post URL yields both the full page URL and the /blog category. That lets you compare which pages and sections generate the most leads and return, and decide where to direct future effort.
Four reports worth building in Dynamics 365
- Leads by Channel: monthly lead counts split by source channel (Organic Search, Paid Search, Paid Social and so on). Useful for budget allocation across channels.
- Leads by Meta Ads Network: when Meta campaigns run across Facebook, Instagram and Messenger, this breaks leads down by network so spend can follow the strongest performer.
- Customers by Google Ads campaign: monthly customer counts per campaign, showing which campaigns convert rather than merely attract clicks.
- Revenue by Keyword: if the keyword is placed in the UTM parameters behind Google Ads using tracking templates, revenue can be attributed to search terms and bids adjusted accordingly.
{{OWNER_CUSTOMER_STORY_HARRIS_FEDERAL}}
A decision checklist before you build
- Does every lead-capture form carry all six hidden fields, with names matching exactly?
- Does the tracking script load on every page, not only landing pages?
- Does your transfer route (native integration or connector) map each hidden field to a Dynamics 365 field?
- Are click IDs stored so they can be sent back as offline conversions later?
- Do your reports separate channel, campaign and landing page so you can act on each level?
- Is the classification stored at arrival so a visitor who navigates before submitting is still attributed correctly?
Where to go next
Once the six fields are live and the transfer route is confirmed, the remaining work is reporting discipline: pick the channel, campaign and landing-page views that match how you allocate budget, and review them on a regular cadence. If you want to try the tracking layer described here, {{OWNER_TRIAL_DURATION}} and {{OWNER_SETUP_TIME_CLAIM}}.
| Hidden field | What it holds | Example value |
|---|---|---|
| Channel | Standard marketing channel | Paid Search |
| Channel Drilldown 1 | Top-level source within the channel | |
| Channel Drilldown 2 | Campaign name | Attribution Launch Campaign |
| Channel Drilldown 3 | Specific ad or creative | Attribution Demo Ad |
| Landing Page | First page the visitor arrived on | www.exampleanalytics.com/product/attribution |
| Landing Page Group | Subdirectory or category of that page | Product |
Example values come from a paid-search scenario; your own values depend on the UTM parameters on your campaigns.
Frequently asked questions
Does this work for leads that don't come from paid ads?
Yes. The channel classification covers Organic Search, Organic Social, Direct traffic, Referral and other sources, so every lead carries a source, not only those arriving with UTM parameters.
What happens if a visitor browses several pages before submitting a form?
The classification is stored in the browser when the visitor first arrives, so the original attribution is preserved regardless of which page the form is submitted on. Tools that only read UTM parameters on the landing page lose the data in this situation.
How does the data get from the form into Dynamics 365?
The form tool captures the hidden field values alongside the contact details. From there, a native integration or a connector such as Zapier or Make moves the values into Microsoft Dynamics 365.
Why capture click IDs like GCLID and MSCLKID?
Click IDs let you send customer-level outcomes back to the ad platform as offline conversions. That means campaigns can be optimized around paying customers rather than form submissions or thank-you page visits.