Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Capturing lead source in UTM's

Posted on by

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
    Leah Ju 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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans