Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Form capturing multiple forms in a Single Page Application

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

I'm trying to capture two different forms (which are both in different url paths) in our Single Page Application. 

When I go to one of these paths, the script provided gets loaded and everything works properly.

The problem that I'm facing is when I navigate from the path of one form to the other one. It gives us the following error, since the script is already there: 
MsCrmFormLoader is already defined, make sure Dynamics 365 Marketing loader.js script is not included twice in the page.

Could someone guide me on what would be the best approach to solve it? 

  • Suggested answer
    Dsouza_28 Profile Picture
    Dsouza_28 7 on at
    RE: Form capturing multiple forms in a Single Page Application

    Hi ,

    The issue can stem from different direction here based on redendering/Load function call. 

    Please check the following solutions:

    1. Is the javascript function registered twice on the onload event? if yes, delete the duplication

    2. Does the javascript function calls another function that loads the web resource? ex: body=onload is called twice ? Self-execution happening twice anywhere?

    3. If none of the above then see if there is a: delete MsCrmMkt.MsCrmFormLoader and try again. 

  • gfscp Profile Picture
    gfscp 5 on at
    RE: Form capturing multiple forms in a Single Page Application

    Hi Roy, thanks for the answer.

    Yes, both forms are in the same domain. We are currently using only one form tracking script for the form capturing, but I don't think we are using the web tracking one. Should we be using it?

    On the other side, we have embedded the script directly in the code on a component that gets rendered on these two pages.

  • Dsouza_28 Profile Picture
    Dsouza_28 7 on at
    RE: Form capturing multiple forms in a Single Page Application

    Hi , 

    If I understood correctly , both the forms reside in the same web domain. So you just need one Web tracking script and one form tracking script. 

    Where have you pasted the form JS script? In the CMS webpage or Google tag manager? 

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans