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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans