We're really not certain about how to successfully integrate your javascript snippet onto our pages in order to return Insights data from the website?
Using the default Javascript code that is displayed under our website and which looks similar to this -
<!--Dynamics Marketing Website Tracking Tag-->
<div id="XX"></div><script src="">mktdplp102cdn.azureedge.net/.../ws-tracking.js class="d365-mkt-config" style="display:none" data-website-id="XXX" data-hostname="XXX.svc.dynamics.com"></div>
<!--End Dynamics Marketing Website Tracking Tag-->
We have attempted to firstly integrate this into our Google Tag Manager container and then to just place it on the actual HTML page, first within the top of the <body> tag (it is not just javascript but is a <div> element so cannot sit within the <head> of the HTML) and then at the end of the <body> element.
None of these implementations work?
Can you advise on where we need to place your javascript code in order to get it firing correctly?
This is why I'm never bothering to learn actual web development. Looks super hard.
Hi,
What if just want to track page visits only without capturing any form.
- I created a Marketing website and then copied the JS code and pasted it into the external page, but I can't get any insights.
- And will this affect if the marketing is installed on the powerapps portal rother than hosted on the external CMS!
Thanks Clofly, good to know.
Hi Stripey,
Yes, at least a form is required to be embedded on the page.(Actually the really required thing is form-loader.js)
For a real example: when using form capture feature, it only show us form-loader.js in the popup.
Even if we can find that ws-tracking.js has been also generated after opening the form page record of the lookup field, however, insights can be return when there is only form-loader.js embedded on the page.
Generally speaking, we put <div> into body section and <script> into header section. In other word, <div> and <script> of automatically generated script can be put separately.
Test reply?
Hi,
We do not want forms on each page, unfortunately? As we understood it the website tracking snippet would return insights on all visits.
Are you saying that if we embed a dynamics marketing form on a page then that page will return insights?
Also, can you confirm the way in which we need to actually embed this tracking <div> element on to the page please? this is not entirely clear in the documentation.
Thank you
Hi Stripey,
According to the my test result from this thread:
By default there is ws-tracking.js, however, insights data were only generated after embedding a marketing form to marketing page.
So it would be concluded that ws-tracking.js should work together with form-loader.js to track page visitors interactions.
You could embed the form-loader.js and hide the form using CSS to do tracking.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156