I'm just getting started with the Magento CMS and I am not sure that it can do what I need right know. I need to include some custom javascript in every pages of my site :
- One line of js code in
<head> - At the end of the
bodya remote script like :<script src="https://..." type="text/javascript"></script>followed by some inline js.
I have seen other answer on this topic but nothing would really fit this particular requirement. Is it even possible to do something like this with magento ? (I am using Magento 2.1.5)
Thanks guys
1 Answer 1
I managed to solve this myself. I was looking for something complex but this is in fact pretty easy.
- Access the admin dashboard and authentificate
- In content -> Design -> Configuration, Select the store you want to add your script into and select Edit
- For the
headpart, just past the code into HTML Head -> Scripts and Style Sheets - For the
bodypart just past the code into Footer -> Miscalleneous HTML - Click Save Configuration
- In System -> Tools -> Cache Management. Select all items and Submit a Refresh
- Finally browse to your website and open the developer console to be sure that your js is loaded.