Developing and testing CloudPages

I use the HTTPGET() AMPScript function to pull in the content from an external web server when developing pages. Like this:

%%=TreatAsContent(HttpGet(Concat("http://example.com/your-page.html?x=",GUID())))=%%

Then when everything is functional, then I copy the code from the web server back into the Cloud Pages and publish it.

This method also works for email development.


I use the ContentBlockbyKey() AMPScript function in the landing page, to pull in the main body of code from a content block, like this:

%%=ContentBlockbyKey("ContentBlockTestSSJS")=%%

On each request of the landing page, the referenced content block resolves to whatever updates I've saved regardless of any caching. So you don't have to wait 5 minutes to test your page.

This method does not work if you have client side JavaScript in the content block - it seems that Content Builder strips out client side JS. But it does work for all AMPscript, HTML, CSS and SSJS.