Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Unanswered

How to add script injector from 3rd party API?

(0) ShareShare
ReportReport
Posted on by 5

Hi Guys,

Were working on project in commerce dynamics365 Store Front. To add a script in the Templates  > Html Head > adding inline script module to be use in home page templates. As for checking we tried to add a simple console.log and alert(). then publish the changes  but its not shows the logs and alert.. as for the the 3rd party API they recommend that this be put in the <head> element on each page. Any idea if this possible can you show us how to apply it step by step. TIA!

 

  • Romel0607 Profile Picture
    Romel0607 5 on at
    RE: How to add script injector from 3rd party API?

    Yes, its D365 Commerce. Now the alert and console.log is working without adding the script tags. For our main goal we have a third party external script that tracks (add to cart, remove from cart and purchase in cart)  transactions.  Currently we add a external script and internal script see attached file below.

    2020_2D00_05_2D00_29_5F00_13h44_5F00_26.png

    As per said in the previous message 3rd party API they recommend that this be put in the <head> element on each page. Also we used to move up the external script to be sure its initiate the script first.

    Our challenges now is the inline script showing its called first because of the error  "
    Cannot read property 'config' of undefined" we sure that external script is working because we can access it in the browser. Another challenges is how we inject the script on the the add to cart, remove from cart and purchase in cart buttons or methods.

  • Xusheng Profile Picture
    Xusheng on at
    RE: How to add script injector from 3rd party API?

    What you want to do? Can you please share more details? Is this relate to D365 for Commerce?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans