Best Way for Shopify App Developers to Install JavaScript Chatbot Code on All Store Pages

Hello @ThePilsen

  1. Index Page Inclusion: for the home page you can add an index as a template then your code works on the home page.I have added an index and some other templates in the schema you can check the code below.
{% schema %}
  {
    "name": "App Name",
    "target": "body",
    "enabled_on": {
      "templates": ["index","article", "page","product","collection","blog","cart","404","search","policy","gift_card","list-collections","password","customers/account"]
      // Add a template name where you want to add your JS code. you can add all template names  so you js code work on all pages// Add a template name where you want to add your JS code. you can add all template names  so you js code work on all pages
    },
    "settings": []
  }
{% endschema %}​
  • Schema Code Placement: You can add your scheme code in the blocks folder if the blocks folder is not there then create a blocks folder. and chat.liquid file into the blocks folder with schema code.
  • Schema Code Placement: The screen depicted in the image is the extension screen where you can update your extension information. When you run npm run deploy, the Shopify CLI automatically makes all changes to your extension. Therefore, you don’t need to take care of this. The CLI handles it for us

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.