For BigCommerce customers a native tool is provided that allows them to insert scripts directly into the template. However, in this one you can only add a 'script' tag, so here you add the CDN part.
To do this go to your BC backend, Storefront > Script Manager > Create a script:
Complete and select the following options:
- Name of the script: df-recommendations
- Description: Recomms
- Location on page: Head
- Select pages where script will be added: All pages
- Script Category: Essential
- Script type: URL
- Load method: Default
- Script URL:
The df-recommendations tag has to be added directly to the theme, if not Bigcommerce will block non-script tags in the Script Manager.
Go to Storefront > Themes > Current theme > Customize > HTML:
Note: We suggest that you make a copy of your theme before changing it in case you need it later.
Now add the script inside the HTML box:
hashid="0caea29130b996f90e3380541db23d83" (use your own hash ID)
region="us1" (use your region eu1 or us1)
Then save and publish.
Select your theme again, and look for the option to Edit theme files. Example: Storefront > Themes > Advanced > Edit Theme Files > Templates > Components > Products > Product-view.html
Add the script in the place you want to display the recommendations. Remember to enter your hash ID and region.
<h2 class="df-recommendations_title" style="
text-align: center; ">Related Products</h2>
Save and apply all files.
Note: This more customized option allows you to place the tag in a specific file. However, updating the theme may cause your changes to be overwritten, so it is recommended to have a child theme.