CloudPages Development in Salesforce Marketing Cloud

CloudPages Development


In this episode, I've shared a simple method that will save you a considerable amount of time when developing CloudPages in Salesforce Marketing Cloud.


Hello and welcome back to mcChat. In this episode, we’ll look at methods that you can use to streamline CloudPage development.

If you’ve worked with CloudPages, you’ll be aware that testing your pages can be a slow and frustrating process. For a start, any changes that you make to a published page can take up to five minutes to re-publish, as the route to your published page is cached for performance reasons and won’t be updated immediately.

And, if there’s an error in your server-side code, it can be challenging to debug as the page will return a generic 500 error. This is by design, it’s a security consideration as displaying specific error messages could be maliciously exploited. And while you can wrap Server-Side JavaScript try/catch statements around your code to handle and display errors, it still can be a slow process to isolate the offending code.

To speed up the publishing process when building CloudPages, you may want to consider saving your code to a file with a publicly accessible URL and adding some inline AMPscript code on the CloudPage, so your file is interpreted when the page is loaded.

For this example, I’ll use Dropbox, as this file hosting service provides a free and convenient method to save a file locally with a publicly accessible URL. However, you can use any file hosting solution or version control system, for example GitHub Pages, the only requirement is that the URL to your file needs to be publicly accessible.

Once you’ve saved your file locally, select ‘Copy Link’ for the recently saved file from the Dropbox menu. Then add the following AMPscript code to your CloudPage.

Firstly we use the TreatAsContent AMPscript function to force any AMPscript code or personalisation strings in your file to be evaluated on the page.

Next, we use the AMPscript HTTPGet function as a nested function to retrieve your file. Note that for Dropbox, you will need to change ‘www’ to ‘dl,’ to ensure that the raw file is downloaded, rather than a preview version.

Now publish your page. You can now make changes to your local file and refresh the page to see your changes instantly applied on the CloudPage.

Note that this development process should only be used during the development phase and should not be used for production. Once you have completed testing and development, you should replace the inline AMPscript code with the final version of your code.

This tip will save you a considerable amount to time when developing CloudPages.

Thanks for watching. And don’t forget to subscribe to this video channel to for more tips in working with Salesforce Marketing Cloud!


Schedule a Call

If you would like to discuss how you can get the most out of Salesforce Marketing Cloud, then Eliot would love to chat with you! Please click on the button to schedule a call.