web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Capturing lead source in UTM's

(0) ShareShare
ReportReport
Posted on by 20

Hello,

I am capturing the lead sources in url format. All the pages have utm's which can be identified as lead sources. I am capturing this url in a hidden field on the form with the help of below script - 

<div style="display:none">

<script>

MsCrmMkt.MsCrmFormLoader.on("afterFormLoad",

function() {

  document.getElementById("d21380f8-684a-ed11-bba2-0022483ddf2d").value =  document.referrer;

});

</script></div>

I want to know if I can split the url here and only get the utm's in form submissions. Then from form submissions if I can auto populate a custom field on Lead entity.

Thanks.

I have the same question (0)
  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Partner,

    Maybe you can refer to the following link, which guide that how to get URL + UTM Parameters with Javascript:

    https://www.gkogan.co/blog/save-url-parameters/ 

    Also, you can refer to the following links to get UTM Parameters through other ways:

    manueltgomes.com/.../

        

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 182 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans