Skip to main content

Notifications

Announcements

No record found.

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

Publish custom JavaScript on Marketing forms hosted on external CMS etc

Posted on by 135

Currently my understanding on running custom JavaScript code on a marketing form published as javascript code on an external CMS is that you have to embed the code on the actual page in the CMS.
Right now the CMS is maintained by 3rd party company so it's taking a lot of time updating this small code because of the chain of communication. It would be sooo much nicer to be able to maintain and publish ourself.

So, to sum up, the challenge is when you publish marketing forms in CMS that you dont control or maintain yourself - how to make updating the code as smooth as possible

Is it possible to maintain and embed custom JavaScript code on Marketing Forms without having to publish the code on the CMS page itself?
Or is it a way of a one-time-setup on that CMS page to reference the code in a neat way so we can eliminate the 3rd party handling of updates?

Preferably best practice or what your experience is. Any tools better than others, can it be done just in Dynamics or do we need to hook up some 3rd party to achieve this?
If this is already built-in Dynamics Marketing, let me know.

I'm not a developer so please reply any tips with that in mind.
Much appreciated

  • TGT Profile Picture
    TGT 135 on at
    RE: Publish custom JavaScript on Marketing forms hosted on external CMS etc

    This might work. I will have to test for my self.

    Thank you!

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 on at
    RE: Publish custom JavaScript on Marketing forms hosted on external CMS etc

    Hi Thomas,

    Currently embed custom JS code on marketing form is not supported, but you could take solution below as reference:

    1. Sign up a free GitHub account, then create a repository and upload .js file to the folder.

    pastedimage1593678170261v1.png

    pastedimage1593678202221v2.png

    2. The website Jsdelivr is tightly integrated with Github, it provides us with an API to fetch/load any repository file of any user.

    API, the first item: https://github.com/jsdelivr/jsdelivr#github

    e.g:

    My GitHub username is oremao, I created repository called WorkflowBox, and I uploaded clofly.js into it, then I could visit my raw JS code directly with format below:

    cdn.jsdelivr.net/gh/{{GitHub_username}}/{{repo_name}}/{{file}}

    https://cdn.jsdelivr.net/gh/oremao/WorkflowBox/clofly.js

    pastedimage1593678679996v3.png

    3. Embed the script link to our CMS page.

    pastedimage1593678740111v4.png

    fire our external function after form is loaded. (Check here for how to use Marketing form API)

    pastedimage1593678846726v5.png

    4. Result

    pastedimage1593678885938v6.png

    In a word, we host JS file on GitHub, thus we can modify JS code on GitHub server side without to embed code to CMS page again.

    Regards,

    Clofly

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans