This tutorial will show you exactly how to do that manually.
The idea is to:
Now let’s do this!
In your Shopify admin, go to Online Store > Themes > Actions > Edit code.
Under Sections, click Add a new section.
Let’s name it “tapita-section”, for example.
Now go to Tapita Dashboard. Find your page > Settings > Advanced > Generated HTML.
Copy these pieces of code in Generated HTML: all the <script>...</script> parts and the <div id="mydiv"></div> part. Sample code:
When you’re done, click Save.
Now, find the template file of the page type that you want to insert this section into. Note that you can insert Tapita blocks into any page type, including Home page.
In this tutorial, we will try to insert the custom section into Collections.
Let’s open collection.json under Templates and insert our custom section like so:
Note that the order of the values inside “order” property is also the showing order of corresponding sections in Collection pages. In this case we insert “tapita-block” as the last value, so on the frontend it will appear at the bottom of Collections pages. You can change its order inside “order” property to change where it appears on your pages.
Finally, click Save.
What if you only want to include the custom section at one specific page, or insert different sections for different pages?
In that case, you can add some more code in your custom section file (“tapita-section.liquid” in this example) to filter the maskedId by page path, for example:
And change the maskedId at this line from a fixed value to our maskedId variable: