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 :
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!

 

I have the same question (0)
  • Xusheng Profile Picture
    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?

  • Romel0607 Profile Picture
    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 173 Super User 2025 Season 2

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 93 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans