New Ghost user here, but I’ve been building websites for a long time. I use a cookie consent tool that has the ability to generate custom privacy policies. For this to work, I need to create a page (such as /privacy/) and drop in some embedded code which consists of a DIV tag with some content, and a 3rd-party JavaScript file that, when the page loads, rewrites the content of the DIV tag with the custom privacy policy it fetches from the cookie consent tool’s server.
I’ve tried using the HTML component, and I can see the preview of the 3rd-party code when editing. But, once I publish, this gets stripped out it seems as there is no sign of this on the frontend.
For reference, I’m self-hosting this site.
So, I’m hoping to find out if this is even possible using the standard web interface, and if not, could there be ways for me to code this on my own by directly editing template files?
That’s what I thought, too. But when I view the page after publishing, none of the content inside the red box shows up, I don’t even see the containing DIV. So it doesn’t seem to be a matter of the JavaScript file not firing, it almost seems as if the entire HTML element was blocked. In the screenshot below, I added a basic h2 heading to see if any of the content in this HTML element winds up on the published page, and I don’t even see that.
I figured it out, once you mentioned caching. To test that, I added a bunch of “regular” content to the page, cleared cache on Cloudflare, and still nothing. So then I checked the sidebar for this page.
Turns out, I must have have set the page access to a membership level that I’d set up when still playing around, and I later deleted that membership level, so that dropdown was empty. Once I set it to public, everything started working. So, basic mistake on my part.
thanks for the prompt help, and going through the troubleshooting with me, which did help me find my mistake.