Skip to main content
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.

  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Capturing lead source in UTM's

    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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans