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

Community site session details

Session Id :
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? 

I have the same question (0)
  • Suggested answer
    Dsouza_28 Profile Picture
    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
    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
    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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 182

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans