Home App Docs Blog Github

Custom script not returned by the html API

Hi!

I have an issue when using some custom javascript which fetches some products from an external source.
The script runs fine in the visual builder, see screenshot and the products are corrected shown.

When using api to retrieve html, however, the javascript piece is missing, and the error is triggered (in this case about it being blocked by an adblocker).
<div class=\"rs-adblock\"> <img src=\"https://assets.rewardstyle.com/production/97d333a5533460e95e1450629f19012a6cf92d42/images/search/350.gif\" onerror='this.parentNode.innerHTML=\"Disable your ad blocking software to view this content.\"' style=\"width: 15px; height: 15px\" /><noscript >JavaScript is currently disabled in this browser. Reactivate it to view this content.</noscript > </div>

Is this expected behaviour? I’ve tried the option to run the script on the client only, but no difference,
Many thanks,
Vincent

Hi,

I worked around it by using the react SDK instead of the html API.

Best,
Vincent

Sorry for the slow response, and I’m glad you were able to get it working!