This is May from Shopify, and welcome to our Shopify Community!
When adding your code to the RTE, you'll want to make sure that you click on the '<>' button
<script> tag and closing it with
</script>. If you have any CSS code for styling, you'll also need to wrap it with a
</style> tag. It is important to note that since the RTE is already the
<body> of the web page, please do not include opening tags such as
<body> inside your RTE. If you include these tags, the RTE will recognize the entire content as a string, and it will not compile your code properly.
Here's an example of what your code should look in your RTE:
After you save your changes, depending on the code, you might need to adjust your theme code or settings, since it might interfere/overlap with your current theme code. For future reference, if you are seeing issues or unexpected results from your changes, I highly recommend reaching out to a Shopify Expert.
Let me know if this helps! If you have any followup questions, feel free to reply back to this thread!