Visual Editor is blocked - what to do?
Your website preview is blocked in the Visual Editor because it cannot be displayed in an iframe. To allow your website to be shown in the CUX app, consider trying one of the following options that best suits your needs:
1. Disable the X-Frame-Options header. However, we recommend replacing X-Frame-Options with Content Security Policy (CSP), as CSP provides a more comprehensive security solution.
2. Adjust the Content Security Policy (CSP) configuration to include the following:
script-src https://dc.cux.io
connect-src wss://n-511951087-0-48201600-1729154260-6710ccd475ae9.track.cux.io
connect-src wss://o-511951087-0-48201600-1729154260-6710ccd475ae9.track.cux.io
frame-ancestors: https://app.cux.io
3. Check if our script is integrated with your website and is allowed to run. If you only tested if the script is firing properly in the GTM debugger but haven’t published the tag - the Visual Editor won’t work. It also won’t work if your Cookie Consent blocks our tag from firing. In this case - see the next tip below.
Visual Editor is working but the Cookie Consent pop-up appears at every pageload
If your Visual editor is working, but you have a cookie consent that appears after each pageload - most likely it is caused by cookie consent settings. To configure your tag to fire in an iframe but skip cookie consent, follow these steps:
1. Create a custom JavaScript Variable: This variable will detect if the tag is fired in an iframe and will return true if it is, otherwise, it will return false.
function() {
try {
return window.top !== window.self
&& window.top.location.href.includes('app.cux.');
} catch(e) {
return false;
}
}
2. Create a trigger with the next conditions:
3. Set two tags for firing CUX script:
For regular pages: Use your standard trigger and cookie consent logic.
For iframe: Use your new trigger with the custom JavaScript Variable as an additional condition, allowing the tag to fire without cookie consent if it's inside an iframe.
This ensures your tag will bypass cookie consent checks only in an iframe while maintaining regular behavior elsewhere.
If you need any help, feel free to reach out to us at [email protected]
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article